Members from your team have different perspectives over C# coding styles however your team want everyone to follow agreed guideline as if code is written by a single developer and it’s readable?
Are you tired of seeing/receiving linting comments in the C# code reviews?
Do you want to automatically find and fix those as a part of C# code self-reviews?
remove unused variables, remove unused methods, remove unused namespaces and MANY MORE.
Answer to these questions are combination of tools:
If you have a single or multiple project make sure you create a .editorconfig at root level (Solution level) so that all the rules are applicable to all the projects under a solution.
- Open your project solution in the visual studio 2019.
- Right click on your solution file
- Click on New EditorConfig. It will create a file with pre-configured rules.
- Install StyleCopAnalyzers using the NuGet command line or the NuGet Package Manager in Visual Studio 2019 for all the projects.
- Right click on solution and Click build. Now it will start showing fixable things as warnings in your IDE’s “Error List” window.
Raise the bar
You can even push yourself and set few rules as errors in the .editorconfigs
Do you want to try it before applying it to your project?
Here is the git repo link: