Disable specific language

Please provide

  • Operating system: Windows 10 Version 21H2 (Build 19044.2846)
  • SonarLint plugin version: 3.17.0
  • Programming language you’re coding in: CPP
  • Is connected mode used: No
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:
I use other extensions for some of the languages supported by Sonarlint so I would like to know how to disable a language

Hey there.

Using standalone mode, you can disable all rules.

Can you tell us which languages you want to disable, and what other extensions are taking SonarLint’s place? It would be great knowledge for us.

Can you please elaborate further? I tried googling standalone mode, but to no avail

Can I jump on here ?

I have the same problem as @vanbang :
We’re also developing in C++ and sonar analysis are set up via sonar-project.properties against own running instance of a SonarQube server. So far so good…

For sonarlint in VSCode we’ve setup connected mode which apparently works since we see the issues in VSCode. However, a message pops up in VSCode that sonarlint is unable to analyse YAML because no node.js v14 is installed. That’s true, but we don’t want sonarlint to analyse YAML files. The only YAML files we have are for gitlab pipelines. There’re also tons of messages about truescript and javascript (and others) we dont want to trigger sonarlint.

How can this be disabled ?

I’ve read in one post to edit the project properties to remove all the extensions for each language we don’t want to be analysed. Since we’re using several sonar projects, that is a pain to modify. Also, the properties don’t let me removeall extensions, at least one needs to be there.

Could that be somehow handled through the sonar-project.properties file ?

1 Like

Hello @DannyBoy we are interested to know why you prefer SonarLint to not analyze those files.
Do you also want SonarQube to skip the analysis of those files? In case you can configure file/directory exclusions in SonarQube for your project, they will be also applied by SonarLint thanks to the connected mode.

1 Like

We’re doing pure C/C++ Development, we don’t have any true script/javascript files to be analyzed. Snarling, however, complains, that no node.js is installed because of wanting to analyze such files.

We don’t have access to the SonarQube instances Administrative settings. This is managed by our Administrators. However, we can configure the Project Settings.
What is preferred ? SonarQube Project Settings or sonar.exclusions in the sonar-project.properties ? Is there any benefit of one or the other ?

In order to configure file/directory exclusions that are applied by SonarQube AND SonarLint, you’ll need to set exclusions in your Project settings. The sonar-project.properties file is used by the scanner but not by SonarLint.

Unfortunately, setting files exclusions will disable the analysis on those files but it will not prevent the missing Node.js message, as the dependency is checked before considering the exclusions. We’ll probably get rid of this warning in the future as we plan to embed the runtime with SonarLint.

Unfortunately, setting exclusions in the Project settings is annoying and painful since one has to set each extension to be ignored one by one (it’s not a simple comma-separate text entry) for each project concerned. And I even don’t know which extension to add without looking first into the output window and deriving it from the warning message.
I hope future versions will handle this more user-friendly and preferably locally before even contacting the server. Why not through the sonar-project.properties file ?

1 Like