Skip to content

feat: move AWT106 to a DiagnosticAnalyzer so it is suppressible in-source#17

Merged
vbreuss merged 1 commit into
mainfrom
feature/awt106-analyzer
Jun 27, 2026
Merged

feat: move AWT106 to a DiagnosticAnalyzer so it is suppressible in-source#17
vbreuss merged 1 commit into
mainfrom
feature/awt106-analyzer

Conversation

@vbreuss

@vbreuss vbreuss commented Jun 27, 2026

Copy link
Copy Markdown
Member

AWT106 (disposable transient) was emitted by the source generator, where #pragma warning disable / [SuppressMessage] cannot suppress it. Move the diagnostic to a new AwaitenAnalyzer in the same assembly so it honours in-source suppression at the registration; the generator no longer reports it.

  • Extract RawRegistration + registration collection into a shared ContainerRegistrations used by both generator and analyzer.
  • RawRegistration carries the live Roslyn Location (not the equatable LocationInfo) so the per-syntax-tree pragma map applies; the generator converts to LocationInfo at its use sites.
  • Suppress AWT106 in the deliberate disposable-transient test fixtures.
  • Add an analyzer test harness and an in-source-suppression test.

Also set Stryker coverage-analysis to off: C# 14 extension member blocks lower into [CompilerGenerated] methods that per-test coverage cannot attribute, which wrongly reported AwaitenResolverExtensions as 0% mutation score.

@vbreuss vbreuss self-assigned this Jun 27, 2026
@github-actions

Copy link
Copy Markdown

Test Results

 18 files  ±0   18 suites  ±0   24s ⏱️ -7s
 58 tests +1   57 ✅ +1  1 💤 ±0  0 ❌ ±0 
278 runs  +3  277 ✅ +3  1 💤 ±0  0 ❌ ±0 

Results for commit 76f9c15. ± Comparison against base commit 22264f4.

@github-actions

Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

Awaiten

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

…urce

AWT106 (disposable transient) was emitted by the source generator, where
#pragma warning disable / [SuppressMessage] cannot suppress it. Move the
diagnostic to a new DisposableTransientAnalyzer in the same assembly so it
honours in-source suppression at the registration; the generator no longer
reports it.

- Extract RawRegistration + registration collection into a shared
  ContainerRegistrations used by both generator and analyzer.
- RawRegistration carries the live Roslyn Location (not the equatable
  LocationInfo) so the per-syntax-tree pragma map applies; the generator
  converts to LocationInfo at its use sites.
- Suppress AWT106 in the deliberate disposable-transient test fixtures.
- Add an analyzer test harness and an in-source-suppression test.

Also set Stryker coverage-analysis to off: C# 14 extension member blocks
lower into [CompilerGenerated] methods that per-test coverage cannot
attribute, which wrongly reported AwaitenResolverExtensions as 0% mutation
score.
@vbreuss vbreuss force-pushed the feature/awt106-analyzer branch from 76f9c15 to 9249764 Compare June 27, 2026 14:39
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss vbreuss merged commit 4a6163b into main Jun 27, 2026
9 checks passed
@vbreuss vbreuss deleted the feature/awt106-analyzer branch June 27, 2026 14:41
@github-actions

Copy link
Copy Markdown

This is addressed in release v0.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant