rabbitmq-dotnet-client
rabbitmq-dotnet-client copied to clipboard
Consider adding static analysis
There are a few analyzers provided by Microsoft: https://github.com/dotnet/roslyn-analyzers
There's also one from Sonar (https://www.nuget.org/packages/SonarAnalyzer.CSharp/) and their platform (https://www.sonarqube.org/).
There's also .editorconfig (https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options). This would enforce style on the code base and would prevent contributors to inadvertently make useless changes to the code.
All good ideas but a .editorconfig
perhaps should be its own issue.
Done! #448
#689 resolved the .editorconfig
suggestion.
Moving to version 7.0.0
. We would appreciate help on implementing the use of a static analyzer.
Challenge accepted :)
Codacy is free for open source and is quite capable. It also supports SonarQube's configuration format so it can be committed to source. We use it and are quite happy with it. Someone with administrative rights to this repository can set up analysis by logging in to Codacy and performing a few steps.
If there's anything I can do to help, please holler!
Infersharp may also be a low-hanging fruit worth implementing since it's available as a GitHub Action:
- name: Run C# Code Analyzer
uses: microsoft/[email protected]
id: runcsharpcodeanalyzer
with:
binary-path: '<path to the binary directory containing .dlls and .pdbs>'
- name: C# Code Analyzer analysis results
run: echo "${{ steps.runcsharpcodeanalyzer.outputs.results }}"
I think a good first step is looking at and figuring out which Roslyn analyzers to enable and which to set as warning and error. There are a bunch of new ones coming in .NET 5.0 as well.
Please see https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/1269