Pandatech.Analyzers 1.6.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pandatech.Analyzers --version 1.6.0
                    
NuGet\Install-Package Pandatech.Analyzers -Version 1.6.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="Pandatech.Analyzers" Version="1.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pandatech.Analyzers" Version="1.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Pandatech.Analyzers" />
                    
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 Pandatech.Analyzers --version 1.6.0
                    
#r "nuget: Pandatech.Analyzers, 1.6.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 Pandatech.Analyzers@1.6.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=Pandatech.Analyzers&version=1.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Pandatech.Analyzers&version=1.6.0
                    
Install as a Cake Tool

Pandatech.Analyzers

Company Roslyn analyzers for enforcing Pandatech coding rules.

Currently the package contains rules around async method conventions, and is intended to grow over time with additional internal policies.

PT0001 – Async methods must end with Async

Definition of async:

A method is considered async if its return type is one of:

  • System.Threading.Tasks.Task
  • System.Threading.Tasks.Task<T>
  • System.Threading.Tasks.ValueTask
  • System.Threading.Tasks.ValueTask<T>

Rule:

Such methods must have a name ending with Async.

Examples:

Task<int> GetValueAsync(CancellationToken ct);     // OK
Task<int> GetValue(CancellationToken ct);          // PT0001

PT0002 – Async methods must accept a CancellationToken

Async methods must include a CancellationToken parameter:

Examples:

Task<int> GetValueAsync(int id, CancellationToken ct);    // OK
Task<int> GetValueAsync();                                // PT0002

PT0003 – CancellationToken parameter must be named ct

If an async method declares a CancellationToken, it must be named ct.

Examples:

Task<int> GetValueAsync(int id, CancellationToken ct);        // OK
Task<int> GetValueAsync(int id, CancellationToken token);     // PT0003

PT0004 – CancellationToken parameter must be last If an async method declares a CancellationToken, it must be the last parameter. Examples:

Task<int> GetValueAsync(int id, CancellationToken ct);        // OK
Task<int> GetValueAsync(CancellationToken ct, int id);        // PT0004
Task<int> GetValueAsync(CancellationToken ct);                // OK

Usage

Add the package to the projects you want analyzed:


<ItemGroup>
    <PackageReference Include="Pandatech.Analyzers" Version="1.0.0" PrivateAssets="all"/>
</ItemGroup>

Configure severities via .editorconfig:

dotnet_diagnostic.PT0001.severity = error   # Async suffix
dotnet_diagnostic.PT0002.severity = error   # CT missing
dotnet_diagnostic.PT0003.severity = error   # CT name
dotnet_diagnostic.PT0004.severity = error   # CT position
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
2.1.0 3,307 1/26/2026
2.0.0 180 1/26/2026
1.6.0 1,013 12/6/2025
1.5.0 160 12/6/2025
1.4.3 170 12/6/2025
1.4.2 172 12/6/2025
1.4.1 164 12/6/2025
1.4.0 167 12/6/2025
1.2.0 174 12/6/2025
1.1.0 182 12/6/2025
1.0.0 188 12/6/2025

Async rules final cleanup and bug fixes