SonarLint Extension for VS clutters git commits because of .sonarlint folder

Please provide

  • Operating system: Win11
  • SonarLint plugin version: 6.6.0.49766
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): Connected to SonarCloud

And a thorough description of the problem / question:

We started using SonarCloud and SonarLint and our biggest quarrel is the .sonarlint folder. According to visual studio - Sonar Lint Ruleset files: Gitignore? - Stack Overflow and Connected Mode Sonarlint local files we have to keep the files checked in.

I work in a mid sized company so we have a multitude of projects in the sonarcloud now. The problem is that every time something changes in sonarcloud, every single project contains clutter now as files in the .sonarlint folder change.

For example, with a new sonarcloud version (i assume) the SonarLint.xml ruleset file has changed, by exactly one space:

We have to make a pull request for every single project we have in the sonarcloud now!

We have solved some of the binding clutter by utilizing Directory.Build.props files and linking the sonarlint files that way, but it still doesn’t solve the main problem: Having constantly changing configuration files checked into git.

We have to keep the .sonarlint folder checked in, else, when a new developer clones the repository, the sonarlint extension just edits the .csproj files and adds files to every single project, completely ignoring the Directory.Build.props that’s in place to mitigate exactly that.

This entire thing has cost us a lot of time already, figuring out how we could fix these issues. Is there any way we can ignore the changes in the .sonarlint folder? We don’t see any way to fix this in a way that doesn’t involve having to tell everyone to copy a base .sonarlint folder with empty files from somewhere before activating the extension.

Or, if possible, fixing these issues in the extension itself would be appreciated.

Hi Tobias!

I know it has been a while but I am happy to let you know that the newest Sonarlint version (>=7.0) has fixed your problem as the .sonarlint folder now gets written to %AppData%\Roaming\SonarLint for Visual Studio\Bindings

1 Like

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