-
Notifications
You must be signed in to change notification settings - Fork 363
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
cxx-custom-checks-example-plugin can not to report issue information #2642
Comments
Hello @smileQiny, think you know the entry point in the wiki: An up to date description from SonarSource for plugin development is here:
As first step I would update the pom.xml file to latest versions: This is for sure something you have to update: old: <dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>${sonar.version}</version>
<scope>provided</scope>
</dependency> new: <dependency>
<groupId>org.sonarsource.api.plugin</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>${sonar.plugin.api.version}</version>
</dependency> Than I would have a look to running sensors of the cxx plugin to see what is different. Think an easy one is the Cppcheck sensor: An additional point is, that you always have to activate rules in a quality profile to use them: Hope this helps! Regards, |
Hi,guwirth: Because when I tried to verify, I changed the repo key from "custom-cxx" to "cxx", and the rule I wrote was displayed in the sonar rules web , and the repo display name was "Sonar CXX", not "Custom CXX". In this case, select the rule to activate, perform a sonar-scanner scan, and the check results of the custom defined rule can be displayed in the Sonar web. |
please check pr: #2644 |
Hello @smileQiny,
It depends what you wanna do.
https://javadocs.sonarsource.org/8.9.0.43852/org/sonar/api/server/rule/RulesDefinition.html One thing is to define the rules in the rule repository, the second to read a report, parse the report and create issues with a matching rule ID.
https://javadocs.sonarsource.org/8.9.0.43852/org/sonar/api/batch/sensor/Sensor.html Hope this helps! Regards, |
Hi,guwirth: |
Hi @smileQiny, I close this, there are some changes. Please create a new issue if you are still facing problems.
Regards, |
hi guwirth:
I'm trying to update the example of xx-custom-checks-example-plugin for Sonar 9.9 TLS. After writing the plugin, it successfully loads under Sonar, and the rules are triggered during scanning. However, there are no results reported. Can you provide me with some troubleshooting tips?
CXX Vesrion: C++ (Community) / 2.1.1-SNAPSHOT
Sonar version:9.9
The main process of writing the plugin is as follows:
the log : Please see the attached files for the scan and loading logs.
MobaXterm_WSL-SonarServer.txt
MobaXterm_WSL-OpenEuler23.03_20240227_213752.txt
The validation examples used are the test cases from sonar-cxx. Custom rules are not logging any information, while native rules are logging properly.
Please take some time from your busy schedule to provide some guidance.
The text was updated successfully, but these errors were encountered: