Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 2.73 KB

README.md

File metadata and controls

22 lines (17 loc) · 2.73 KB

.NET 5 Quality Assurance coding rules and best practices

An opinionated set of files and configurations usefull to enforce coding best practices and uniformity in .NET 5 projects

Usage

Just copy all the files into the root of your target solution and/or related subfolders as needed (if and when an override/extension is required).

If your root already contains one or more of these file, you will need to merge them manually.

Root folder

This folder represents the root directory containing all the projects of the solution, and contains the following files:

  • Directory.Build.props → This is the backbone gluing together the other configuration files. It defines the basic NuGet dependencies (and the related configuration files) applied to all the projects in the root folder and its subfolders.
  • .editorconfig → Define an opinionated set of global rules applied to the editor and enforced into the build process via the Roslyn Analyzers referenced by Directory.Build.props:
    • Lindhart.Analyser.MissingAwaitWarningNuGet / GitHub
    • Microsoft.CodeAnalysis.FxCopAnalyzersNuGet / GitHub
    • Microsoft.VisualStudio.Threading.AnalyzersNuGet / GitHub
    • Philips.CodeAnalysis.DuplicateCodeAnalyzerNuGet / GitHub. This analyzer is also parametrized using the DuplicateCode.Allowed.txt file
  • Global.ruleset → define the code styling rules enforced by StyleCop and its StyleCop.Analyzers NuGet package (NuGet / GitHub)
  • BannedSymbols.txt → the configuration file used by the Roslyn Analyzer Microsoft.CodeAnalysis.BannedApiAnalyzers (NuGet / GitHub)
  • DuplicateCode.Allowed.txt → the file containing the exceptions allowed by the Philips.CodeAnalysis.DuplicateCodeAnalyzer (NuGet / GitHub)
  • RiderInspectionSettings.xml → the configuration file used by JetBrains Rider for the editor inspections