Open SierraNL opened 6 years ago
@SierraNL Nice suggestion!
Did you know that CSharpGuidelinesAnalyzer provides 45 roslyn-based analyzers, which were written specifically for the rules in this repository? See here for an overview.
It would be nice to integrate those with SonarQube. However, it looks like SonarQube requires external analyzers to work with v1.x of the Roslyn API, which is very old. CSharpGuidelinesAnalyzer has always depended on newer APIs. So although I have not actually tried, based on documentation I think it is not going to work.
If you want to try out CSharpGuidelinesAnalyzer, I strongly recommend to use a recent prerelease build. I'm in the final testing stage before releasing a new stable version, which will be a major overhaul compared to the current release.
Looks like this should be possible now. Is there still interest for such an integration?
Yes, I would really like to see that integration.
@SierraNL Can you try the steps at https://github.com/SonarSource/sonarqube-roslyn-sdk#getting-started?
RoslynSonarQubePluginGenerator.exe /a:CSharpGuidelinesAnalyzer
It successfully generates a .jar file for me. You should be able to install that into SonarQube.
I'm at a company which uses these guidelines, but also uses SonarQube, a tool which is used more and more in CI / CD pipelines.
It might be a good idea to create a matching ruleset for SonarQube. I think most rules are already implemented: https://rules.sonarsource.com/csharp But new ones can be added through: https://github.com/SonarSource/sonarqube-roslyn-sdk