Pandatech.Analyzers 2.1.0

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

Pandatech.Analyzers

Roslyn analyzers enforcing Pandatech async coding conventions.

Rules

Rule Description
PT0001 Async methods must end with Async
PT0002 Async methods must accept a CancellationToken
PT0003 CancellationToken parameter must be named ct
PT0004 CancellationToken must be the last parameter

A method is async if it returns Task, Task<T>, ValueTask, or ValueTask<T>.

Examples

// ✓ Correct
Task<int> GetValueAsync(int id, CancellationToken ct = default);

// ✗ PT0001: Missing 'Async' suffix
Task<int> GetValue(int id, CancellationToken ct);

// ✗ PT0002: Missing CancellationToken
Task<int> GetValueAsync(int id);

// ✗ PT0003: CancellationToken must be named 'ct'
Task<int> GetValueAsync(int id, CancellationToken token);

// ✗ PT0004: CancellationToken must be last
Task<int> GetValueAsync(CancellationToken ct, int id);

Exclusions

The analyzer automatically skips:

Context Skipped Rules
Entry points (Main, top-level statements) All rules
Interface implementations / overrides PT0001, PT0002, PT0004
Test methods ([Fact], [Test], etc.) PT0002, PT0004
ASP.NET Core middleware (Invoke/InvokeAsync) PT0002, PT0003, PT0004
SignalR hubs and hub interfaces All rules
SignalR client interfaces (Hub<TClient>) All rules

Code Fixes

All rules include automatic code fixes that handle:

  • Interface methods → Updates interface and all implementations
  • Virtual/abstract methods → Updates base and all overrides
  • Regular methods → Updates the single method

Installation


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

Configuration

Configure severity in .editorconfig:

dotnet_diagnostic.PT0001.severity = error
dotnet_diagnostic.PT0002.severity = error
dotnet_diagnostic.PT0003.severity = warning
dotnet_diagnostic.PT0004.severity = warning
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (16)

Showing the top 5 NuGet packages that depend on Pandatech.Analyzers:

Package Downloads
Pandatech.EFCore.PostgresExtensions

The Pandatech.EFCore.PostgresExtensions library enriches Entity Framework Core applications with advanced PostgreSQL functionalities, starting with the ForUpdate locking syntax and BulkInsert function. Designed for seamless integration, this NuGet package aims to enhance the efficiency and capabilities of EF Core models when working with PostgreSQL, with the potential for further PostgreSQL-specific extensions.

Pandatech.ResponseCrafter

Handling exceptions, custom Dtos.

Pandatech.Crypto

PandaTech.Crypto is a .NET library simplifying common cryptograhic functions.

Pandatech.SharedKernel

Pandatech.SharedKernel provides centralized configurations, utilities, and extensions for ASP.NET Core projects. For more information refere to readme.md document.

Pandatech.GridifyExtensions

Pandatech.Gridify.Extensions simplifies and extends the functionality of the Gridify NuGet package. It provides additional extension methods and functionality to streamline data filtering and pagination, making it more intuitive and powerful to use in .NET applications. Our enhancements ensure more flexibility, reduce boilerplate code, and improve overall developer productivity when working with Gridify.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 319 1/26/2026
2.0.0 130 1/26/2026
1.6.0 761 12/6/2025
1.5.0 134 12/6/2025
1.4.3 134 12/6/2025
1.4.2 144 12/6/2025
1.4.1 137 12/6/2025
1.4.0 143 12/6/2025
1.2.0 149 12/6/2025
1.1.0 156 12/6/2025
1.0.0 160 12/6/2025

Bug fix for program.cs