I am developing a Custom Sonar Plugin. It is successfully identifying issues in XSLT code but the issues are not showing up in SonarQube.
Here is some background:
- The custom plugin was built by cloning and refactoring the https://github.com/SonarSource/sonar-custom-plugin-example.
- Custom rules are being generated and activated, and are being displayed in SonarQube.
- I examined a similar issue in the community (Custom plugin java rules don't detect any bugs) but it appeared to be Java-specific, specifically regarding CheckRegister. Is that right?
I derived the issue-reporting code from the example plugin (FooLintIssuesLoaderSensor). I have a PendingIssue class that is analagous to (FooLintIssuesLoaderSensor.ErrorDataFromExternalLinter). Here is an excerpt of my code:
NewIssueLocation newLocation = new DefaultIssueLocation() .on(inputFile) .message(pendingIssue.getMessage()) .at(inputFile.selectLine(lineNumber)); RuleKey ruleKey = pendingIssue.rule(this.repoKey); NewIssue newIssue = context.newIssue() .forRule(ruleKey) .at(newLocation); newIssue.save();
Any suggestions are greatly appreciated!
P.S. I’m running SonarQube 8.0 locally.