KirillMaster.QualityGates.Architecture 0.1.0

dotnet add package KirillMaster.QualityGates.Architecture --version 0.1.0
                    
NuGet\Install-Package KirillMaster.QualityGates.Architecture -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KirillMaster.QualityGates.Architecture" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KirillMaster.QualityGates.Architecture" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="KirillMaster.QualityGates.Architecture" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KirillMaster.QualityGates.Architecture --version 0.1.0
                    
#r "nuget: KirillMaster.QualityGates.Architecture, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package KirillMaster.QualityGates.Architecture@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KirillMaster.QualityGates.Architecture&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=KirillMaster.QualityGates.Architecture&version=0.1.0
                    
Install as a Cake Tool

quality-gates

Reusable quality gates for modern .NET (net8 / net9). MIT licensed.

Package Purpose
KirillMaster.QualityGates.Build Build-only package: warnings-as-errors, AnalysisLevel latest-all, nullable, curated third-party analyzers (Sonar, Meziantou, Roslynator, VS.Threading, IDisposableAnalyzers, BannedApiAnalyzers), own Roslyn analyzers QG0xxx, quality.globalconfig, BannedSymbols.txt, .editorconfig template, grandfathered suppressions.
KirillMaster.QualityGates.Architecture ArchUnitNET-based test base for hexagonal layering, config-driven layers, namespace-cycle check, repository meta-tests (locked settings, central package versions, suppression ratchet, every project covered).

No StyleCop (Roslynator covers it). Legacy .NET Framework (net48) is not supported.

Usage


<GlobalPackageReference Include="KirillMaster.QualityGates.Build" Version="0.1.0" />
<PackageVersion Include="KirillMaster.QualityGates.Architecture" Version="0.1.0" />

Without central package management add <PackageReference Include="KirillMaster.QualityGates.Build" Version="0.1.0" PrivateAssets="all" /> to each project.

Copy templates/editorconfig.template from the package (or src/KirillMaster.QualityGates.Build/templates/) to .editorconfig in the repository root.

MSBuild contract

Property names are shared with the company package so one tool can drive both; the report format is described in docs/contract.md.

Property Default Meaning
QualityGatesEnabled true false turns everything off (set in Directory.Build.props or /p:)
QualityGatesProfile strict strict = latest-all; legacy-ratchet = latest-recommended plus grandfathered suppressions
QualityGatesLayer derived core (*.Domain, *.Application), test (*.Tests, relaxed test config), adapter
QualityGatesBannedSymbols true false drops BannedSymbols.txt
QualityGatesGrandfatheredDir <repo>/quality/grandfathered/ folder with <Project>.GlobalSuppressions.cs files compiled into the project

Analyzers

See docs/analyzers.md. Defaults are warnings, so TreatWarningsAsErrors makes them blocking. Thresholds are tunable in .editorconfig (qg_max_method_lines = 80). QG0031/QG0032 are opt-in.

Architecture tests

public sealed class Layering : HexagonalArchitectureTests
{
    protected override IEnumerable<Assembly> Assemblies => [typeof(Shop.Domain.Order).Assembly, typeof(Shop.Application.IOrders).Assembly];
    protected override ArchitectureConfig Config => ArchitectureConfig.Hexagonal("Shop");
}

public sealed class RepoRules : RepositoryRulesTests { }

ArchitectureConfig.FromFile("architecture.json") loads custom layers: { "layers": [ { "name": "Core", "pattern": "^X\\.Core(\\..*)?$", "mayDependOn": [], "forbiddenNamespaces": ["System.IO"] } ] }. Tests carry Category=Architecture for dotnet test --filter Category=Architecture.

Legacy projects (ratchet)

Set QualityGatesProfile=legacy-ratchet, put existing violations into quality/grandfathered/<Project>.GlobalSuppressions.cs and record the count in quality/baseline.json ({"maxGrandfatheredSuppressions": 42}). Suppressions_stay_under_baseline fails if the count grows or if the baseline is stale, so it can only go down.

Gates and where they run

Gate Mechanism Blocking
Build warnings as errors, analyzers Build package yes, every build
Format dotnet format --verify-no-changes yes (CI job format)
Architecture Architecture package tests yes
Tests dotnet test yes
Diff coverage >= 80 diff-cover on cobertura, PR only (merge gate) yes, merge gate only
Mutation Stryker.NET never blocks (continue-on-error)

See .github/workflows/ci.yml and samples/HexSample.

Develop

dotnet build -c Release
dotnet test -c Release
dotnet pack -c Release        # writes artifacts/*.nupkg

Sample against the local feed: dotnet test samples/HexSample/HexSample.sln (restores from artifacts/).

Releasing

Publishing runs in .github/workflows/release.yml and authenticates to nuget.org with Trusted Publishing (OIDC, no API key stored anywhere). The nuget.org trusted publishing policy must match owner KirillMaster, repository quality-gates, workflow file release.yml.

One-time setup: add the repository variable NUGET_USER (Settings → Secrets and variables → Actions → Variables) set to your nuget.org profile name.

Per release: bump Version in Directory.Build.props, update CHANGELOG.md, then:

git tag v0.1.0 && git push origin v0.1.0

The workflow derives the package version from the tag (v0.1.0 → 0.1.0) and pushes with --skip-duplicate. Manual run: Actions → release → Run workflow, enter version.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 69 10/23/2026