SonarLint in IDEA cant find HTML and yaml bugs

If your question is about SonarLint in the IntelliJ Platform, VS Code, Visual Studio, or Eclipse, please post it in that sub-category.

Otherwise, please provide:

  • Operating system: Windows 7
  • IDE name and flavor/env: IDEA2021.1.2 SonarLint 7.4.0.60471 SonarQube8.9.8.54436

And a thorough description of the problem / question:

After installing SonarLint 7.4.0.60471 to IDEA, I set up to connect it to SonarQube8.9.8.54436

I have developed the Sonar Java custom rule plugin myself (official), which performs normally when scanning with mvn, and can report errors found in IDEA when using Sonarlint

I have developed the sonar html custom rule plugin (official) and sonar yaml custom rule plugin (community) myself. When using sonar scanner for scanning, they perform normally and can detect problems. However, when using IDEA, they cannot automatically detect problems in HTML yaml files. Even if manually scanning files with obvious errors, they will not generate any errors

May I ask what may be the reason for this? thanks

Hi @yixuan004,

I can only provide you with the answer to a previous question which is mostly overlapping:
Third-party analyzers are not supported in SonarLint

I could not phrase it any better than this and even though the post is two years old, nothing has changed on that policy.
The plugins you developed, do they extend the official Sonar analyzers? If not they won’t work in SonarLint and if they do (like the extension to the Java analyzer you mention), they will only work in connected mode.

Best,
Tobias

my html plugin is based on official github project: Release 3.4.0.2754 · SonarSource/sonar-html · GitHub

and other version is SonarLint 7.4.0.60471 SonarQube8.9.8.54436. In the connection mode of IDEA, I still cannot match the error message of HTML, is there a matching relationship between these versions?

Hi @yixuan004,

thanks for the blazingly fast response! I will hand it over to our analyzer experts because I assume when you already use the official analyzer as a baseline there might be something on the analyzer side itself and not directly on SonarLint side.

Please give them a little bit of time to respond to this thread :wink:

Hey @yixuan004

A couple of things.

  • SonarLint for IntelliJ 7.4.0 is out of date. The currently supported version is 8.5.0
  • SonarQube 8.9 LTS is EOL – and you should upgrade to SonarQube 9.9 LTS
  • HTML does not support custom rules via Java development – see the documentation on Adding coding rules. The HTML analyzer itself is bundled into SonarLint and cannot be modified.
  • If you have questions about GitHub - sbaudoin/sonar-yaml: SonarQube plugin to analyze YAML files compatability with SonarLint, I suggest asking the maintainer (I believe it’s not compatible as effectively, it just runs an external tool during analysis)

Sorry we can’t be more help.