Skip to content

Commit d8067ef

Browse files
committed
Small fix
1 parent 66744d9 commit d8067ef

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Analyzers/Analyzers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
<PackageId>Pandatech.Analyzers</PackageId>
1919
<PackageIcon>pandatech.png</PackageIcon>
2020
<PackageReadmeFile>Readme.md</PackageReadmeFile>
21-
<Version>1.4.0</Version>
21+
<Version>1.4.1</Version>
2222
<Authors>Pandatech</Authors>
2323
<Description>Pandatech Roslyn analyzers enforcing company coding rules.</Description>
2424
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2525
<PackageTags>Pandatech, analyzers, roslyn, async, cancellation, coding-rules</PackageTags>
2626
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-analyzers</RepositoryUrl>
27-
<PackageReleaseNotes>Bug fix on lambdas</PackageReleaseNotes>
27+
<PackageReleaseNotes>Small fix</PackageReleaseNotes>
2828

2929

3030
</PropertyGroup>

src/Analyzers/Async/AsyncMethodConventionsAnalyzer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ private static void AnalyzeAsyncMember(IMethodSymbol method,
198198
}
199199

200200
// PT0003 – name must be ct
201-
// Always enforced when CT exists (both interface + implementation),
202-
// so implementations still get "rename to ct".
203-
if (!ctInfo.IsNamedCt)
201+
// Enforced only on non-contract methods (interfaces / non-contract class methods).
202+
// Implementations of contracts (overrides / interface impls) are skipped so we don't
203+
// fight the “implementation params must match interface” rule or external contracts.
204+
if (!ctInfo.IsNamedCt && !isContract)
204205
{
205206
report(Diagnostic.Create(CancellationTokenNameRule, location, displayName, ctInfo.Name));
206207
}
@@ -365,7 +366,7 @@ private static bool IsMinimalApiMapMethod(IMethodSymbol method)
365366
"MapTrace" or
366367
"MapMethods";
367368
}
368-
369+
369370

370371
private static IAnonymousFunctionOperation? ExtractAnonymousFunction(IOperation value)
371372
{

0 commit comments

Comments
 (0)