I am using
I have done followings:
- Created a custom rule in SonarQube.
XML definition is this:
<!-- Generated by Sonar --> <module name="Checker"> <module name="SuppressWarningsFilter"/> <module name="RegexpSingleline"> <property name="severity" value="warning"/> <property name="fileExtensions" value="java"/> <property name="format" value="^takahashi123$"/> <property name="message" value="Violate ^takahashi123$ format."/> </module> <module name="TreeWalker"> <module name="SuppressWarningsHolder"/> <module name="SuppressionCommentFilter"/> </module> </module>
Duplicated quality profile sonar way(java) and added this custom rule to it. And assigned this profile to my project.
Installed SonarLint to IntelliJ and connected the SonarQube Server and my project. and clicked “Update binding” button. I could not find any error in SonarLint log with verbose option.
However, I could not find my custom rule in Rules tab in Intellij settings: Settings - Tools - SonarLint.
My custom rule works only in SonarQube server (scanner).
I also greped the word “takahashi” in the folder “[user folder of windows]\AppData\Roaming\JetBrains\IntelliJIdea2020.1\sonarlint”, and find the word in “global\rules.pg”, “active_rules(hex number)pb]” files, so the custom rule looks to be downloaded to SonarLint.
Does anyone have advice on this case?
Thanks in advance.