Is the file .idea\.idea.***\.idea\sonarlint.xml intended to be under source control?

  • Operating system: Windows 11
  • SonarLint plugin version: 10.8.1
  • IntelliJ version: Rider 2024.1.1
  • Is connected mode used: connected so SonarQube 10.6.0

I would like to understand whether the file .idea\.idea.***\.idea\sonarlint.xml is intended to be under source control or not?
I find some indicators for both…
The file could be intended to be source controlled because

  1. it is not listed in .idea\.idea.***\.idea\.gitignore
  2. it contains configuration which is required for all team members, like sonar.cs.internal.loadProjectsOnDemand

The file could be intended to be not source controlled because

  1. it contains configuration which is user specific, like serverId

The last one is maybe the root cause of my problem. It saves the name of the SonarQube server the user specifies when activating connected mode. This name is not identical to all team members, it is not shared using the .sonarlint\AIS.TC.json!

Is it possible that the value serverId should get the URL of the SQ server than the local alias?

1 Like

Hello @lg2de, we do not recommend putting sonarlint.xml under source control, as it may contain information specific to a user. Given the JetBrains’ recommendation, the .idea folder can be shared, so we understand there might be a mismatch with the SonarLint files. This is under our radar, and we might improve it in the future, likely by moving the files to another location.

Ok, but how to share the plugin configuration sonar.cs.internal.loadProjectsOnDemand?
What is you recommendation here?

Currently, I don’t see an easy way of sharing such configurations with all the team members. Committing the sonarlint.xml could be a workaround, but it comes with all the limitations you already mentioned.

You could perhaps remove the fields serverId, projectKey, bindingEnabled, and commit sonarlint.xml. When people will checkout the file, they should be proposed to automatically import connection thanks to the file .sonarlint\AIS.TC.json, while keeping the configuration already present in the file.

Please, take such update on your roadmap and drop here a note when it is completed.