-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Renew] custom rules support sonar 9.9 #23
Conversation
Signed-off-by: qinyong <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @smileQiny,
looking to the code and past issues:
- Support plugins with custom rules sonar-cxx#667
- Custom rules no longer working with v0.9.8 sonar-cxx#1308
A solution must use:
https://github.com/SonarOpenCommunity/sonar-cxx/blob/d9a044196e2679301a180761dbae3a424ebc2e95/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/CustomCxxRulesDefinition.java#L33
The CxxSquidSensor is using CustomCxxRulesDefinition:
https://github.com/SonarOpenCommunity/sonar-cxx/blob/d9a044196e2679301a180761dbae3a424ebc2e95/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/CxxSquidSensor.java#L116
Finally addCustomChecks is called:
https://github.com/SonarOpenCommunity/sonar-cxx/blob/d9a044196e2679301a180761dbae3a424ebc2e95/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/CxxChecks.java#L57
Maybe I understand it wrong? But current solution seems to be different?
Regards,
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.sonarsource.sonarqube-plugins.cxx</groupId> | ||
<artifactId>sonar-cxx-plugin</artifactId> | ||
<type>sonar-plugin</type> | ||
<version>0.9.7-SNAPSHOT</version> | ||
<version>2.1.1-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this must be the version of the plugin. The "-SNAPSHOT" is replaced with the build number.
@@ -60,8 +59,8 @@ | |||
<artifactId>maven-compiler-plugin</artifactId> | |||
<version>3.8.1</version> | |||
<configuration> | |||
<source>1.7</source> | |||
<target>1.7</target> | |||
<source>10</source> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
<release>${java.version}</release>
<debug>true</debug>
</configuration>
</plugin>
with
<java.version>11</java.version>
<maven-compiler.version>3.12.1</maven-compiler.version>
see https://github.com/SonarOpenCommunity/sonar-cxx/blob/master/pom.xml
@@ -10,21 +10,20 @@ | |||
|
|||
<properties> | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
<sonar.version>8.6.1.40680</sonar.version> | |||
</properties> | |||
|
|||
<dependencies> | |||
<dependency> | |||
<groupId>org.sonarsource.sonarqube</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would keep this:
<dependency>
<groupId>org.sonarsource.api.plugin</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>${sonar.plugin.api.version}</version>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api-impl</artifactId>
<version>${sonar.version}</version>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-testing-harness</artifactId>
<version>${sonar.version}</version>
</dependency>
with
<sonar.version>9.9.0.65466</sonar.version>
<sonar.plugin.api.version>9.14.0.375</sonar.plugin.api.version>
@smileQiny please have a look to #24 |
I merge this one and later one #24 |
No description provided.