chore(analyzers): bump SonarAnalyzer.CSharp to 10.30.0.144632 #176

Closed
panda wants to merge 2 commits from chore/sonaranalyzer-10.30 into main
Collaborator

Summary

Renovate's #173 bumped SonarAnalyzer.CSharp 10.29.0.14377410.30.0.144632 but left CI red: the newer analyzer tightens S8969 (redundant null-forgiving !) and adds S8949 (forward a CancellationToken), and with TreatWarningsAsErrors those fail the build. This is the deliberate analyzer ratchet the repo documents (Directory.Build.props: "Bump these DELIBERATELY … addressing new findings in that same change") — the version bump plus the fixes, in one change. Supersedes #173 (close it in favour of this).

What changed

  • Directory.Build.props: SonarAnalyzer pin → 10.30.0.144632.
  • S8969 — 15 genuine redundant ! removed where the compiler already proves non-null (after Assert.NotNull(...) etc.), across test files.
  • S8969 — 2 false positives on TryXxx pass-throughs (AssetPack.TryGet, GameConnection.TryDequeue) where the ! was actually suppressing a real CS8601. Fixed idiomatically with [MaybeNullWhen(false)] out … (mirroring Dictionary.TryGetValue), so both the compiler and Sonar are satisfied — no suppression.
  • S8949 — 1: Task.Run(ReceiveLoopAsync)Task.Run(ReceiveLoopAsync, CancellationToken.None) (fire-and-forget; the receive loop already handles its own cancellation via _cts.Token, so an explicit opt-out at the scheduling call is the honest choice and avoids an unobserved cancellation on the discarded task).

How it was tested

  • Whole solution builds with 0 warnings under SonarAnalyzer 10.30.0.144632 (TreatWarningsAsErrors).
  • dotnet test IsoMmo.slnx — all green.
  • No .editorconfig severity downgrades, no #pragma suppressions added.
## Summary Renovate's #173 bumped **SonarAnalyzer.CSharp `10.29.0.143774` → `10.30.0.144632`** but left CI red: the newer analyzer tightens **S8969** (redundant null-forgiving `!`) and adds **S8949** (forward a `CancellationToken`), and with `TreatWarningsAsErrors` those fail the build. This is the deliberate analyzer **ratchet** the repo documents (`Directory.Build.props`: *"Bump these DELIBERATELY … addressing new findings in that same change"*) — the version bump **plus** the fixes, in one change. **Supersedes #173** (close it in favour of this). ## What changed - `Directory.Build.props`: SonarAnalyzer pin → `10.30.0.144632`. - **S8969 — 15 genuine** redundant `!` removed where the compiler already proves non-null (after `Assert.NotNull(...)` etc.), across test files. - **S8969 — 2 false positives** on `TryXxx` pass-throughs (`AssetPack.TryGet`, `GameConnection.TryDequeue`) where the `!` was actually suppressing a real `CS8601`. Fixed idiomatically with `[MaybeNullWhen(false)] out …` (mirroring `Dictionary.TryGetValue`), so **both** the compiler and Sonar are satisfied — no suppression. - **S8949 — 1**: `Task.Run(ReceiveLoopAsync)` → `Task.Run(ReceiveLoopAsync, CancellationToken.None)` (fire-and-forget; the receive loop already handles its own cancellation via `_cts.Token`, so an explicit opt-out at the scheduling call is the honest choice and avoids an unobserved cancellation on the discarded task). ## How it was tested - Whole solution builds with **0 warnings** under SonarAnalyzer `10.30.0.144632` (`TreatWarningsAsErrors`). - `dotnet test IsoMmo.slnx` — all green. - No `.editorconfig` severity downgrades, no `#pragma` suppressions added.
chore(analyzers): bump SonarAnalyzer.CSharp to 10.30.0.144632 and fix new findings
All checks were successful
ci / Lint & Test (pull_request) Successful in 2m11s
14e0b62b65
Merge branch 'main' into chore/sonaranalyzer-10.30
Some checks failed
ci / Lua content lint (pull_request) Successful in 44s
ci / Lint & Test (pull_request) Failing after 6m3s
18f8d3b7c7
Author
Collaborator

doppione

doppione
panda closed this pull request 2026-08-02 00:55:41 +02:00
Author
Collaborator

Superseded by #220 (SonarAnalyzer 10.31, the newer bump — rebased on main with the new 10.31 findings fixed, closes #164). Closing this older 10.30 bump.

Superseded by #220 (SonarAnalyzer **10.31**, the newer bump — rebased on main with the new 10.31 findings fixed, closes #164). Closing this older 10.30 bump.
Some checks failed
ci / Lua content lint (pull_request) Successful in 44s
ci / Lint & Test (pull_request) Failing after 6m3s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!176
No description provided.