Pandatech.Analyzers
1.6.0
dotnet add package Pandatech.Analyzers --version 1.6.0
NuGet\Install-Package Pandatech.Analyzers -Version 1.6.0
<PackageReference Include="Pandatech.Analyzers" Version="1.6.0" />
<PackageVersion Include="Pandatech.Analyzers" Version="1.6.0" />
<PackageReference Include="Pandatech.Analyzers" />
paket add Pandatech.Analyzers --version 1.6.0
#r "nuget: Pandatech.Analyzers, 1.6.0"
#:package Pandatech.Analyzers@1.6.0
#addin nuget:?package=Pandatech.Analyzers&version=1.6.0
#tool nuget:?package=Pandatech.Analyzers&version=1.6.0
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.TaskSystem.Threading.Tasks.Task<T>System.Threading.Tasks.ValueTaskSystem.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
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.
Async rules final cleanup and bug fixes