|
| 1 | +# ASP.NET 5 Quality Assurance coding rules and best practices |
| 2 | +An opinionated set of files and configurations usefull to enforce coding best practices and uniformity in ASP.NET 5 projects |
| 3 | + |
| 4 | +# Content of this project and basic assumptions |
| 5 | +This repository assumes that there are two "levels" |
| 6 | +- **Root** folder → the root directory containing all the projects of the solution |
| 7 | + - **WebSite** folder → a folder containing an hypotetical ASP.NET 5 web application, *inheriting and extending* the settings contained into the _Root_ folder |
| 8 | + |
| 9 | +# Usage |
| 10 | +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). |
| 11 | + |
| 12 | +If your root already contains one or more of these file, you will need to merge them manually. |
| 13 | + |
| 14 | + |
| 15 | +# Root folder |
| 16 | +This folder represents the root directory containing all the projects of the solution, and contains the following files: |
| 17 | + |
| 18 | +- **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. |
| 19 | +- **.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_: |
| 20 | + - **Lindhart.Analyser.MissingAwaitWarning** → [NuGet](https://www.nuget.org/packages/Lindhart.Analyser.MissingAwaitWarning/) / [GitHub](https://github.com/ykoksen/unused-task-warning) |
| 21 | + - **Microsoft.CodeAnalysis.FxCopAnalyzers** → [NuGet](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/) / [GitHub](https://github.com/dotnet/roslyn-analyzers) |
| 22 | + - **Microsoft.VisualStudio.Threading.Analyzers** → [NuGet](https://www.nuget.org/packages/Microsoft.VisualStudio.Threading.Analyzers/) / [GitHub](https://github.com/Microsoft/vs-threading) |
| 23 | + - **Philips.CodeAnalysis.DuplicateCodeAnalyzer** → [NuGet](https://www.nuget.org/packages/Philips.CodeAnalysis.DuplicateCodeAnalyzer/) / [GitHub](https://github.com/philips-software/roslyn-analyzers). This analyzer is also parametrized using the _DuplicateCode.Allowed.txt_ file |
| 24 | +- **Global.ruleset** → define the code styling rules enforced by StyleCop and its _StyleCop.Analyzers_ NuGet package ([NuGet](https://www.nuget.org/packages/StyleCop.Analyzers/) / [GitHub](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)) |
| 25 | +- **BannedSymbols.txt** → the configuration file used by the Roslyn Analyzer _Microsoft.CodeAnalysis.BannedApiAnalyzers_ ([NuGet](https://www.nuget.org/packages/Microsoft.CodeAnalysis.BannedApiAnalyzers/) / [GitHub](https://github.com/dotnet/roslyn-analyzers)) |
| 26 | +- **DuplicateCode.Allowed.txt** → the file containing the exceptions allowed by the _Philips.CodeAnalysis.DuplicateCodeAnalyzer_ ([NuGet](https://www.nuget.org/packages/Philips.CodeAnalysis.DuplicateCodeAnalyzer/) / [GitHub](https://github.com/philips-software/roslyn-analyzers)) |
| 27 | +- **RiderInspectionSettings.xml** → the configuration file used by [JetBrains Rider](https://www.jetbrains.com/rider/) for the editor inspections |
| 28 | + |
| 29 | + |
| 30 | +# WebSite subfolder |
| 31 | +This folder represents a directory containing an hypotetical ASP.NET 5 web application, *inheriting and extending* the settings contained into the _Root_ folder, |
| 32 | +The files are: |
| 33 | +- **Directory.Build.props** → Inherit and extends the _Directory.Build.props_ contained into the parent folder, and hooks a [Gulp](https://gulpjs.com/) task in the `BeforeTargets="PostBuildEvent"` that process the JS files using [ESLint](https://eslint.org/) |
| 34 | +- **package.json** → install [Babel](https://babeljs.io/), [ESLint](https://eslint.org/) and other basic dependencies. Also define the `eslint` script launched via [Gulp](https://gulpjs.com/), used to execute [ESLint](https://eslint.org/) |
| 35 | +- **gulpFile.js** → define the [Gulp](https://gulpjs.com/) tasks used to process [ESLint](https://eslint.org/) and [SCSS](https://sass-lang.com/). Search for the `TODO` comments into the file to customize your process |
| 36 | +- **.eslintrc.js** → an opinionated set of [ESLint](https://eslint.org/) rules. Customize them as needed. |
| 37 | +- **.eslintignore** → the file defining the paths that [ESLint](https://eslint.org/) should ignore. Customize them as needed. |
0 commit comments