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 adding static analysis #444

Closed
paulomorgado opened this issue Sep 8, 2018 · 9 comments
Closed

Consider adding static analysis #444

paulomorgado opened this issue Sep 8, 2018 · 9 comments

Comments

@paulomorgado
Copy link
Contributor

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.

@michaelklishin
Copy link
Member

All good ideas but a .editorconfig perhaps should be its own issue.

@paulomorgado
Copy link
Contributor Author

Done! #448

@lukebakken
Copy link
Contributor

#689 resolved the .editorconfig suggestion.

@lukebakken lukebakken added this to the 6.0.0 milestone Jan 30, 2020
@lukebakken lukebakken self-assigned this Jan 30, 2020
@lukebakken lukebakken modified the milestones: 6.0.0, 7.0.0 Mar 14, 2020
@lukebakken
Copy link
Contributor

Moving to version 7.0.0. We would appreciate help on implementing the use of a static analyzer.

@stebet
Copy link
Contributor

stebet commented Mar 14, 2020

Challenge accepted :)

@asbjornu
Copy link
Contributor

asbjornu commented Oct 9, 2020

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!

@asbjornu
Copy link
Contributor

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/CSharpCodeAnalyzer@v0.1
  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 }}"

@stebet
Copy link
Contributor

stebet commented Oct 14, 2020

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.

@michaelklishin michaelklishin removed this from the 8.0.0 milestone Jan 26, 2021
@lukebakken lukebakken added this to the 7.0.0 milestone Dec 21, 2023
@lukebakken
Copy link
Contributor

Please see #1269

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

No branches or pull requests

5 participants