chore(lint): deliberately bump analyzers + fix new S8969 (redundant null-forgiving) findings #164

Open
opened 2026-07-23 18:58:05 +02:00 by marco · 1 comment
Owner

Deliberately bump the pinned analyzers and fix the findings the newer version surfaces.

Background

Analyzer versions are now pinned exactly in Directory.Build.props (Roslynator.Analyzers 4.15.0, SonarAnalyzer.CSharp 10.29.0.143774) after a floating 10.* pulled a newer SonarAnalyzer on CI that tightened S8969 ("remove the redundant null-forgiving !") and broke the build while local passed. Pinning restored reproducibility; this issue is the deliberate ratchet.

Scope

  • Bump SonarAnalyzer.CSharp (and Roslynator.Analyzers) to the latest, pinned exactly.
  • Fix every new finding it reports, notably the S8969 redundant ! sites seen on the failing run:
    • src/IsoMmo.Assets/AssetPack.cs:15
    • tests/IsoMmo.Client.Core.Tests/Automation/DebugCommandTests.cs:13
    • tests/IsoMmo.GameServer.Tests/Gameplay/CombatSkillTests.cs:51
    • tests/IsoMmo.GameServer.Tests/Gameplay/WorldEntityViewsTests.cs:23,70
    • tests/IsoMmo.GameServer.Tests/Gameplay/WorldTests.cs:90,97,718,1095,1099,1129,1143
  • Confirm just lint + whole-solution build are clean on the bumped version.

Definition of Done

  • Analyzers pinned to the newer exact versions; dotnet build IsoMmo.slnx is zero-warning.
  • No remaining S8969 (or other new-rule) findings; no rule downgraded to hide them.
  • Base DoD (tests green, whole build, multi-platform).
Deliberately bump the pinned analyzers and fix the findings the newer version surfaces. ## Background Analyzer versions are now pinned exactly in `Directory.Build.props` (`Roslynator.Analyzers 4.15.0`, `SonarAnalyzer.CSharp 10.29.0.143774`) after a floating `10.*` pulled a newer SonarAnalyzer on CI that tightened **S8969** ("remove the redundant null-forgiving `!`") and broke the build while local passed. Pinning restored reproducibility; this issue is the *deliberate* ratchet. ## Scope - Bump `SonarAnalyzer.CSharp` (and `Roslynator.Analyzers`) to the latest, pinned exactly. - Fix every new finding it reports, notably the **S8969** redundant `!` sites seen on the failing run: - `src/IsoMmo.Assets/AssetPack.cs:15` - `tests/IsoMmo.Client.Core.Tests/Automation/DebugCommandTests.cs:13` - `tests/IsoMmo.GameServer.Tests/Gameplay/CombatSkillTests.cs:51` - `tests/IsoMmo.GameServer.Tests/Gameplay/WorldEntityViewsTests.cs:23,70` - `tests/IsoMmo.GameServer.Tests/Gameplay/WorldTests.cs:90,97,718,1095,1099,1129,1143` - Confirm `just lint` + whole-solution build are clean on the bumped version. ## Definition of Done - [ ] Analyzers pinned to the newer exact versions; `dotnet build IsoMmo.slnx` is zero-warning. - [ ] No remaining S8969 (or other new-rule) findings; no rule downgraded to hide them. - [ ] Base DoD (tests green, whole build, multi-platform).
Collaborator

Implemented by #176. That PR bumps SonarAnalyzer.CSharp 10.29.0.143774 → 10.30.0.144632 and fixes every new finding — all the S8969 sites listed here, plus 2 that were false positives on TryXxx pass-throughs (AssetPack.TryGet, GameConnection.TryDequeue), fixed with [MaybeNullWhen(false)] instead of removing a ! that was suppressing a real CS8601, plus one new S8949 (forward a CancellationToken). Whole solution builds 0 warnings; no suppressions/downgrades. Roslynator is already at the latest pinned 4.15.0 (Renovate has no newer PR open), so nothing to bump there. This issue can close when #176 merges.

Implemented by #176. That PR bumps `SonarAnalyzer.CSharp` 10.29.0.143774 → **10.30.0.144632** and fixes every new finding — all the S8969 sites listed here, plus 2 that were false positives on `TryXxx` pass-throughs (`AssetPack.TryGet`, `GameConnection.TryDequeue`), fixed with `[MaybeNullWhen(false)]` instead of removing a `!` that was suppressing a real CS8601, plus one new S8949 (forward a CancellationToken). Whole solution builds 0 warnings; no suppressions/downgrades. Roslynator is already at the latest pinned 4.15.0 (Renovate has no newer PR open), so nothing to bump there. This issue can close when #176 merges.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#164
No description provided.