Refs #15 — increment 1 of the incremental analyzer rollout (the issue stays open for promotions). Zero source/code churn; build-config only.
What
Adds Roslynator, SonarAnalyzer.CSharp, Meziantou.Analyzer, AsyncFixer as central analyzer references (Directory.Build.targets, CPM-versioned, guarded on ManagePackageVersionsCentrally so the gitignored .mcp tool isn't pulled in).
.editorconfig defaults dotnet_analyzer_diagnostic.severity = suggestion → packs surface findings without breaking the TreatWarningsAsErrors build. Promotion is the enforcement: raising a rule to warning makes it a CI-blocking error via the existing TWAE build — no new lint step needed.
Deliberate calls (deviations stated)
StyleCop excluded: latest stable1.1.118 crashes (AD0001) on C# records and overlaps the existing .editorconfig/Roslynator. Revisit via 1.2.0-beta only if wanted.
Blazor .razor: editorconfig severity overrides don't reach analyzer diagnostics in Razor @code (source-generator limitation — confirmed [*.razor] sections and dotnet format both no-op). The currently-firing Sonar rules (374 findings / 85 files) are temporarily NoWarn-ed in ErsatzTV.csproj and burned down rule-by-rule in #25. The same rules run at suggestion on .cs.
Formatting normalization deferred to its own PR (mixed UTF-8 BOM + whitespace; ~1,500 + ~480) — kept out of here to stay reviewable.
Refs #15 — **increment 1 of the incremental analyzer rollout** (the issue stays open for promotions). Zero source/code churn; build-config only.
## What
- Adds **Roslynator**, **SonarAnalyzer.CSharp**, **Meziantou.Analyzer**, **AsyncFixer** as central analyzer references (`Directory.Build.targets`, CPM-versioned, guarded on `ManagePackageVersionsCentrally` so the gitignored `.mcp` tool isn't pulled in).
- `.editorconfig` defaults `dotnet_analyzer_diagnostic.severity = suggestion` → packs surface findings **without breaking the `TreatWarningsAsErrors` build**. **Promotion is the enforcement**: raising a rule to `warning` makes it a CI-blocking error via the existing TWAE build — no new lint step needed.
## Deliberate calls (deviations stated)
- **StyleCop excluded**: latest *stable* `1.1.118` crashes (`AD0001`) on C# `record`s and overlaps the existing `.editorconfig`/Roslynator. Revisit via `1.2.0-beta` only if wanted.
- **Blazor `.razor`**: editorconfig severity overrides don't reach analyzer diagnostics in Razor `@code` (source-generator limitation — confirmed `[*.razor]` sections and `dotnet format` both no-op). The currently-firing Sonar rules (374 findings / 85 files) are temporarily `NoWarn`-ed in `ErsatzTV.csproj` and **burned down rule-by-rule in #25**. The same rules run at `suggestion` on `.cs`.
- **Formatting normalization deferred** to its own PR (mixed UTF-8 BOM + whitespace; ~1,500 + ~480) — kept out of here to stay reviewable.
## Verification
- Full-solution Release build (TWAE on) → **0 errors, 0 warnings**.
- No `.cs`/`.razor` source changed, so runtime behavior/tests are unaffected (PR `test` job confirms).
## Follow-ups
- **#25** — burn down the suppressed `.razor` Sonar rules (incremental).
- Formatting normalization PR + `dotnet format --verify-no-changes` CI gate.
- Promote curated high-value rules suggestion→warning (next #15 increments).
Add Roslynator, SonarAnalyzer.CSharp, Meziantou.Analyzer, and AsyncFixer as central
analyzer references (Directory.Build.targets, CPM-versioned, guarded on
ManagePackageVersionsCentrally so the gitignored .mcp tool isn't affected).
.editorconfig defaults dotnet_analyzer_diagnostic.severity to `suggestion` so the packs
surface findings without failing the TreatWarningsAsErrors (TWAE) build; rules are
promoted to warning/error incrementally (promotion = enforcement via the existing TWAE
build, so no separate lint step is needed).
StyleCop.Analyzers is intentionally excluded: its latest stable (1.1.118) crashes
(AD0001) on C# records and overlaps the existing .editorconfig/Roslynator.
Blazor .razor: editorconfig severity overrides don't reach analyzer diagnostics in Razor
@code (source-generator limitation; dotnet format can't fix them either), so the
currently-firing SonarAnalyzer rules are temporarily NoWarn-ed in ErsatzTV.csproj and
burned down rule-by-rule in #25. The same rules run at suggestion on .cs.
Formatting normalization (mixed UTF-8 BOM + whitespace) is deferred to its own PR.
Full-solution Release build green (0 errors, 0 warnings).
Refs #15
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
timothy
merged commit f2d0a36ed6 into main2026-06-27 09:37:15 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Refs #15 — increment 1 of the incremental analyzer rollout (the issue stays open for promotions). Zero source/code churn; build-config only.
What
Directory.Build.targets, CPM-versioned, guarded onManagePackageVersionsCentrallyso the gitignored.mcptool isn't pulled in)..editorconfigdefaultsdotnet_analyzer_diagnostic.severity = suggestion→ packs surface findings without breaking theTreatWarningsAsErrorsbuild. Promotion is the enforcement: raising a rule towarningmakes it a CI-blocking error via the existing TWAE build — no new lint step needed.Deliberate calls (deviations stated)
1.1.118crashes (AD0001) on C#records and overlaps the existing.editorconfig/Roslynator. Revisit via1.2.0-betaonly if wanted..razor: editorconfig severity overrides don't reach analyzer diagnostics in Razor@code(source-generator limitation — confirmed[*.razor]sections anddotnet formatboth no-op). The currently-firing Sonar rules (374 findings / 85 files) are temporarilyNoWarn-ed inErsatzTV.csprojand burned down rule-by-rule in #25. The same rules run atsuggestionon.cs.Verification
.cs/.razorsource changed, so runtime behavior/tests are unaffected (PRtestjob confirms).Follow-ups
.razorSonar rules (incremental).dotnet format --verify-no-changesCI gate.