It seems as if I have no rule defined

Please provide

  • Operating system: Windows 10
  • SonarLint plugin version: 6.13
  • Programming language you’re coding in: C++
  • Is connected mode used:No, Standalone
    • Connected to SonarCloud or SonarQube (and which version): No

And a thorough description of the problem / question:
I want to try SonarLint in Visual Studio 2019, I have installed the extension.
I wanted to try it on an example provided here, and there is no error found :

[SecretsAnalyzer] Analyzing D:\V7\src\plugins\DynaworksAnalysis\replaymanager.cpp
[SecretsAnalyzer] Finished analyzing D:\V7\src\plugins\DynaworksAnalysis\replaymanager.cpp, analysis time: 0,025s
[SecretsAnalyzer] Found 0 issue(s) for D:\V7\src\plugins\DynaworksAnalysis\replaymanager.cpp
[CFamily] Using cached rule settings
[CLangAnalyzer] Analyzing D:\V7\src\plugins\DynaworksAnalysis\replaymanager.cpp
[CFamily Analysis] Internal error in the analysis subprocess: Compiler execution failed. Compiler path: cl.exe.
[CLangAnalyzer] Failed to analyze D:\V7\src\plugins\DynaworksAnalysis\replaymanager.cpp: See above for more information.

When I activate Extensions > SonarLint > Options in Visual 2019, and then click on “Edit rules settings”, it opens an empty settings.json file :

  "sonarlint.rules": {}

Is it norma that I have no rule defined ? how can I inject the 598 rules defined for C++ ?

Kind regards,

Hey there.

sonarlint.rules is used to enable/disable rules – but the default rules will apply whether or not this file is populated.

As for the error you’re receiving, take a look at this thread:

Thanks very much for your answer Colin ! :slight_smile:

I have published an environment variable ‘ClCompilerPath’ with the path to cl.exe as in the thread you mentioned, but it does not seem to solve the issue, I still have the same error message about cl.exe
I have tried with and without “cl.exe” at the end of the path, in case of