kgen.Analyzers.Repository 1.0.9

Prefix Reserved
dotnet tool install --global kgen.Analyzers.Repository --version 1.0.9
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local kgen.Analyzers.Repository --version 1.0.9
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=kgen.Analyzers.Repository&version=1.0.9
                    
nuke :add-package kgen.Analyzers.Repository --version 1.0.9
                    

Analyzers.Repository

Analyzers.Repository is a code quality tool that scans your .NET repository and identifies common configuration issues. It checks for problems with project structure, dependencies, copyright notices, and build configuration best practices.

What Does It Check?

The tool runs multiple analyzers on your repository:

  • Directory Structure (KG001-KG002): Validates proper directory configuration
  • Dependency Management (KG003): Recommends using Directory.Packages.props for centralized package version management
  • Build Configuration (KG004): Identifies duplicate properties between Directory.Build.props and individual .csproj files
  • Build Configuration (KG004, KG007, KG008): Identifies duplicate properties between Directory.Build.props and individual .csproj files; ensures split Directory.Build.*.props/.targets are imported by the main Directory.Build.props (KG007); requires Directory.Build.Analyzers.props when a root Directory.Build.props exists (KG008)
  • Copyright Year (KG005): Ensures copyright headers in files include the current year
  • Solution File Format (KG006): Validates solution file format preferences

Getting Started

Run a Scan

The easiest way to use the tool is to run it directly without installing:

# Scan your current directory
dotnet tool exec kgen.analyzers.repository -d .

# Scan a specific directory
dotnet tool exec kgen.analyzers.repository -d /path/to/repo

# Exclude certain folders from the scan
dotnet tool exec kgen.analyzers.repository -d . -e "bin/**" -e "obj/**"

This approach always runs the latest version of the tool.

Install the Tool (Optional)

If you prefer to install the tool globally:

dotnet tool install --global kgen.analyzers.repository

Command-Line Options

  • -d, --directory <dir>: Directory to scan (default: current directory)
  • -e, --exclude <pattern>: Patterns to exclude from the scan (minimatch-style). Can be repeated multiple times.

Understanding the Results

When the tool finds issues, it will display them with:

  • An error code (e.g., KG003) - use this to look up specific rules
  • A severity level (Error or Warning)
  • A description of the issue
  • The file path and location where the issue was found

Suppressing Rules

If you want to ignore specific checks, you can disable them by passing rule codes. Refer to the documentation links provided with each error for more information about what each rule means and how to fix it.

Reporting Issues

Found a bug or have suggestions? Please open an issue on GitHub. When reporting:

  1. Include the error code (KG###) from the output
  2. Describe what you expected vs. what you got
  3. Share the relevant command you ran
  4. If possible, include a minimal example of your repository structure that reproduces the issue

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

This package has no dependencies.

Version Downloads Last Updated
1.0.9 144 6/27/2026
1.0.8 137 5/21/2026
1.0.7 114 5/21/2026
1.0.6 106 5/21/2026
1.0.5 119 5/20/2026
1.0.4 109 5/20/2026
1.0.3 106 5/19/2026
1.0.2 127 5/18/2026
1.0.1 116 5/17/2026
1.0.0 127 5/17/2026