Chaws.DotNet.CodingStandards
1.0.1
See the version list below for details.
dotnet add package Chaws.DotNet.CodingStandards --version 1.0.1
NuGet\Install-Package Chaws.DotNet.CodingStandards -Version 1.0.1
<PackageReference Include="Chaws.DotNet.CodingStandards" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Chaws.DotNet.CodingStandards --version 1.0.1
#r "nuget: Chaws.DotNet.CodingStandards, 1.0.1"
// Install Chaws.DotNet.CodingStandards as a Cake Addin #addin nuget:?package=Chaws.DotNet.CodingStandards&version=1.0.1 // Install Chaws.DotNet.CodingStandards as a Cake Tool #tool nuget:?package=Chaws.DotNet.CodingStandards&version=1.0.1
Chaws' Coding Standards
This repo is a place for me to keep all my shared configuration between projects in one place. These configurations are very opinionated to fit the way I like to work.
Since this is an internal tool for my personal projects, new features will be enabled by default and versioning will not follow
semver
.
Usage
<Project>
<PropertyGroup>
<Product>My Awesome Project</Product>
<Authors>Christopher.Haws</Authors>
<CopyrightHolder>Christopher Haws</CopyrightHolder>
</PropertyGroup>
<PropertyGroup>
<Company>Contoso</Company>
<Company>Contoso</Company>
</PropertyGroup>
</Project>
Roadmap
- - Add logging to log changed features (toggleable)
- - Add the ability to build containers via
EnableSdkContainerSupport
- - Look into if it is possible to detect installed packages and enable/disable features based on that
- - Add tests to validate that everything works (could use Buildalyzer)
Features
Reproducible Builds
These packages are used to:
- keep builds idempotent
- sets a bunch of properties based on the CI pipeline you use to help keep your builds consistent across platforms
- sets up SourceLink on your build to make it easier to debug into your project's source code
- prevents the build from unintentionally depending on other installed software that's not described by your repo
- other cool things! Go check out their github for more info! 😃
Preconfigured Static Analysis
I like to live on the edge in my personal projects so I have the analysis level set to preview
. If you prefer to set the level to something else, you can do so by setting this value yourself:
<PropertyGroup>
<AnalysisLevel>latest</AnalysisLevel>
<PropertyGroup>
Microsoft.VisualStudio.Threading.Analyzers
Microsoft.CodeAnalysis.PublicApiAnalyzers
This package contains rules to help library authors monitoring change to their public APIs.
Microsoft.CodeAnalysis.BannedApiAnalyzers
Purpose Allows banning the use of arbitrary code using a txt file.
Relavent Files BannedSymbolsFile
Disable
<PropertyGroup>
<IncludeDefaultBannedSymbols>false</IncludeDefaultBannedSymbols>
</PropertyGroup>
Microsoft.CodeAnalysis.NetAnalyzers
This is the default analyzer that ships with .NET. Including it manually means we will get updates without needing to update .NET.
Nullable.Extended.Analyzer
Disable
<PropertyGroup>
<DisableNullableExtendedAnalyzer>true</DisableNullableExtendedAnalyzer>
</PropertyGroup>
Meziantou.Analyzer
JetBrains Annotations
This meta package adds JetBrains.Annotations
and adds it's namespace to the implicit usings.
Access internal types with UnitTests
This package allows you to access internal types in tests as long as you name your test project {ProjectName}.Tests
Access internal types with LINQPad durring development
I use LINQPad a lot during development for prototyping and experimenting. Being able to reference my assemplies and use the internal types is very handy!
Building
nuget pack Chaws.DotNet.CodingStandards.nuspec -ForceEnglishOutput -Version 1.0.0
Build-in SDK Properties and Items
References
Learn more about Target Frameworks and .NET Standard.
-
- Meziantou.Analyzer (>= 2.0.14)
- Microsoft.CodeAnalysis.BannedApiAnalyzers (>= 3.3.4)
- Microsoft.CodeAnalysis.NetAnalyzers (>= 7.0.0)
- Microsoft.CodeAnalysis.PublicApiAnalyzers (>= 3.3.4)
- Microsoft.VisualStudio.Threading.Analyzers (>= 17.5.22)
- Nullable.Extended.Analyzer (>= 1.10.4539)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.