Suppress noisy analyzer rules in benchmarks and examples csproj#97
Merged
Chris-Wolfgang merged 1 commit intoMay 2, 2026
Conversation
CI surfaced remaining analyzer errors in benchmarks and examples that my earlier fix only addressed in the test csproj. Same root cause: the Windows CI runner doesn't fully honor .editorconfig section relaxations for [benchmarks/**/*.cs] and [examples/**/*.cs], so we move the suppressions to the project level where MSBuild applies them reliably. Benchmarks NoWarn: MA0004, VSTHRD200, S6966 Examples NoWarn: MA0004, S6966 Verified: 0 warnings/errors local clean build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves a small set of analyzer suppressions from .editorconfig into the affected benchmark and example project files so MSBuild applies them reliably on Windows CI. It fits the codebase’s existing pattern of relaxing analyzer rules for non-library projects without changing runtime behavior.
Changes:
- Add project-level
NoWarnentries to the .NET 8 example project forMA0004andS6966. - Add project-level
NoWarnentries to the benchmark project forMA0004,VSTHRD200, andS6966. - Document in each
.csprojwhy these suppressions are duplicated at the project level instead of relying only on.editorconfig.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/CSharp.DotNet8.Example/CSharp.DotNet8.Example.csproj | Adds project-level analyzer suppressions for the example app to stabilize CI behavior. |
| benchmarks/Wolfgang.TryPattern.Benchmarks/Wolfgang.TryPattern.Benchmarks.csproj | Adds project-level analyzer suppressions for benchmark code where those rules are intentionally relaxed. |
3b7a5e1
into
chore/fix-analyzer-violations-result-try
9 of 11 checks passed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI's Stage 2 (Windows) is reporting analyzer errors in the benchmarks and examples projects:
benchmarks/Wolfgang.TryPattern.Benchmarks/TryBenchmarks.cs— VSTHRD200, MA0004examples/CSharp.DotNet8.Example/Program.cs— MA0004, S6966These rules are already relaxed in
.editorconfig's[benchmarks/**/*.cs]and[examples/**/*.cs]sections, but the Windows CI runner doesn't fully honor those section relaxations (same root cause we hit on the test project). Moving the suppressions to the project level via<NoWarn>makes MSBuild apply them reliably.What
NoWarnforMA0004,VSTHRD200,S6966NoWarnforMA0004,S6966Both blocks include a comment explaining why the suppressions live at the project level rather than relying on
.editorconfig.Verification
dotnet build --configuration Release→ 0 warnings, 0 errors locallyContext
Split off from #94 per request — keeps that PR focused on the cancellation-token observance + test-project fixes and lets this benchmarks/examples cleanup land independently.
🤖 Generated with Claude Code