Feature Request: Disable SonarQube from running unless the project is in Connected Mode

Please provide

  • Operating system: Not Relevant
  • SonarQube for VS Code plugin version: v4.29.0
  • Programming language you’re coding in: Not Relevant
  • Is connected mode used: Depends
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):

And a thorough description of the problem / question:
TLDR: I’m looking for an option where I can disable SonarQube from running when the project / folder / file VS CODE has opened, does not have Connected Mode. Does such and option exist? If not can it be build?

Scenario:

I work on many different projects in my company (and sometimes outside e.g. open source) and only some of those are using SonarQube with Connected Mode. In which case I would very much like to run the analysis and get suggestions from SonarQube.

But in many other projects SonarQube is not used. In those projects I would like the SonarQube plugin to not analyze the code, nor make suggestions.
I can provide a few scenarios in which case you would not want SonarQube to analyze:

  1. The project already makes use of another linting setup and SonarQube is applying conflicting rules.
  2. The project makes use of an old version of the language and the rules SonarQube suggests don’t match with that version of the language.

As these are project specific concerns, updating my general sonar rules does not make sense.

Nor is it nice to add VsCode setting files to all the projects with specific Sonar settings, as not all members working on that project are making use of SonarQube (or VsCode for that matter).

The Request / Question:

The bare minimum that would be nice is: if all sonarlint.rules could be disabled in the settings.json from either the system and/or the user. E.g. ”sonarlint.rules” : { “all“ : “off“ }. or “sonarlint.rules“ : null

But it would be nicer if there was an option that doesn’t even analyze the files when no Connected Mode options can be found.

Hi Colin,

Thanks for your feedback! We understand it’s frustrating that SonarLint for VS Code doesn’t currently allow you to disable analysis and you’re right, this feature is already available in our IntelliJ and Eclipse extensions.

We’ve added your request to our backlog and will consider it for a future release. We appreciate you bringing this to our attention!

2 Likes