Document configurability of sonar-dotnet

When using the SonarAnalyzer.CSharp NuGet package (i.e. not the Sonar VS extension or SonarQube) it’s not clear how rules can be configured. I figured out that you can do it with a SonarLint.xml file (see this SO answer) but among all the Sonar* projects I couldn’t find any official information on this.

So, please document it (or if it’s documented already then link from GitHub - SonarSource/sonar-dotnet: Code analyzer for C# and VB.NET projects https://redirect.sonarsour).

Hi @Piedone . Welcome to the community.

We don’t have such a guide yet. However you can see how we do it in our own repository for SonarLint Connected mode (and you can reuse the same concept for the nuget package):

I hope this helps.

Best,
Andrei

Thanks Andrei, I actually did exactly that. As mentioned, I figured out how to configure the NuGet package, however, some documentation in the repo of sonar-dotnet would have been really helpful (like adding your message to the root Readme).

So, this is a feature request for sonar-dotnet. I didn’t add it to an issue there because opening a thread here is what the instructions say there.

Thanks for the suggestion @Piedone , it makes sense. I’ve added a new README section (and a new PR to improve it).

Cheers,
Andrei

Great, thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.