Skip to content
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

Consider creating a ruleset for SonarQube #178

Open
SierraNL opened this issue Jun 20, 2018 · 4 comments
Open

Consider creating a ruleset for SonarQube #178

SierraNL opened this issue Jun 20, 2018 · 4 comments

Comments

@SierraNL
Copy link

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

@bkoelman
Copy link
Contributor

@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.

@bkoelman
Copy link
Contributor

bkoelman commented Sep 4, 2019

Looks like this should be possible now. Is there still interest for such an integration?

@SierraNL
Copy link
Author

Yes, I would really like to see that integration.

@bkoelman
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants