Atya.Governance.CodeQuality 1.0.0

dotnet add package Atya.Governance.CodeQuality --version 1.0.0
                    
NuGet\Install-Package Atya.Governance.CodeQuality -Version 1.0.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="Atya.Governance.CodeQuality" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Atya.Governance.CodeQuality" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Atya.Governance.CodeQuality" />
                    
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 Atya.Governance.CodeQuality --version 1.0.0
                    
#r "nuget: Atya.Governance.CodeQuality, 1.0.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 Atya.Governance.CodeQuality@1.0.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=Atya.Governance.CodeQuality&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Atya.Governance.CodeQuality&version=1.0.0
                    
Install as a Cake Tool

CodeQuality

Reusable NuGet package for centralized code-quality policy across Atya repositories.

Purpose

This package provides one shared place for analyzer and coding-style configuration. Projects that reference it receive the same .NET analyzer settings, StyleCop settings, and selected StyleCop analyzer assemblies.

The package is intentionally explicit: it enables the analyzer rules documented by this policy, but it does not force broad AnalysisMode presets or XML documentation generation on consuming projects.

Contents

  • buildTransitive/Atya.Governance.CodeQuality.props
    • Enables SDK analyzers and wires shared config files into consuming projects.
  • buildTransitive/Atya.Governance.CodeQuality.globalconfig
    • Shared analyzer severities, naming rules, and code-style policy.
  • buildTransitive/stylecop.json
    • StyleCop-specific behavior, such as using placement and ordering behavior.
  • analyzers/dotnet/cs/*.dll
    • Repacked StyleCop analyzer assemblies.
  • docs/CODING_STYLE.md
    • Shared coding-style documentation.

Usage

Reference the package from a consuming project:

<PackageReference Include="Atya.Governance.CodeQuality" Version="1.0.0" PrivateAssets="all" />

The package uses buildTransitive, so the analyzer policy flows automatically into projects that reference it.

Use the shared repository .editorconfig alongside this package for formatting/editor behavior. If the same analyzer key is defined in both .editorconfig and this package's global analyzer config, the repository .editorconfig wins.

Policy scope

The package currently enforces:

  • selected .NET analyzer/code-style rules, such as nameof(...), unnecessary this., predefined type keywords, readonly fields, and unused suppressions;
  • selected StyleCop rules for using placement/order, member/modifier ordering, braces/blank lines, accessibility modifiers, and naming;
  • private/internal field prefixes (_camelCase, s_camelCase) through .NET naming rules.

The package does not enforce StyleCop XML documentation/file-header rules by default.

Local development

When testing the package from this repository with a ProjectReference or a direct .props import, remember that this is not the same as consuming the packed NuGet package. A project reference does not automatically expose the package's analyzers/dotnet/cs assets.

For local analyzer demos, either:

  • reference the packed .nupkg, or
  • add StyleCop.Analyzers directly to the sample project.

The shared stylecop.json file should still come from buildTransitive/Atya.Governance.CodeQuality.props.

To compile the intentionally wrong sample files and inspect diagnostics:

dotnet build samples/CodeQuality.Sample.Console/CodeQuality.Sample.Console.csproj -p:EnableWrongStyleExamples=true

Pack

dotnet pack -c Release
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

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
1.0.0 673 5/1/2026