Skip to content

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

License

Notifications You must be signed in to change notification settings

DogmaSolutions/AspNet6.QA.Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

ASP.NET 6 Quality Assurance coding rules and best practices

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

Content of this project and basic assumptions

This repository assumes that there are two "levels"

  • Root folder → the root directory containing all the projects of the solution
    • WebSite folder → a folder containing an hypotetical ASP.NET 6 web application, inheriting and extending the settings contained into the Root folder

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

WebSite subfolder

This folder represents a directory containing an hypotetical ASP.NET 6 web application, inheriting and extending the settings contained into the Root folder, The files are:

  • Directory.Build.props → Inherit and extends the Directory.Build.props contained into the parent folder, and hooks a Gulp task in the BeforeTargets="PostBuildEvent" that process the JS files using ESLint
  • package.json → install Babel, ESLint and other basic dependencies. Also define the eslint script launched via Gulp, used to execute ESLint
  • gulpFile.js → define the Gulp tasks used to process ESLint and SCSS. Search for the TODO comments into the file to customize your process
  • .eslintrc.js → an opinionated set of ESLint rules. Customize them as needed.
  • .eslintignore → the file defining the paths that ESLint should ignore. Customize them as needed.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published