Skip to content

Eliminate #pragma warning disable across the codebase — rewrite code so analyzer warnings don't fire #355

Open

Description

@thomas-stegemann

111 files under src/ and tests/ carry #pragma warning disable blocks. Commit 6974da7e removed every suppression from the test-pillar files (TestRunner, FlowTestRunner, their tests) and establishes the patterns to reuse:

  • CA1031 (broad catch at 3rd-party plugin/transport boundaries): catch (Exception ex) when (PluginBoundary.NonFatal(ex)) — CA1031 does not flag filtered catch clauses, the intent lives in one documented helper (src/Kuestenlogik.Bowire.Tool/PluginBoundary.cs), and fatal exceptions (OOM/AV) escape instead of being swallowed. Promote the helper to a shared location when sweeping other projects.
  • CA1861: fixture arrays → static readonly fields.
  • CA1308: char-wise char.ToLowerInvariant via string.Create when lowercase output is genuinely required.
  • CS1998: stub async iterators await Task.CompletedTask before yield break.
  • xUnit1051: pass TestContext.Current.CancellationToken even on guard-clause calls.

Remaining hotspots (pragma count): BowireCatalogueOverride (13), Tool/PluginManager (10), BowirePluginEndpoints (8), Mock/UnaryReplayer (7), SidecarBowireProtocol (6), RestInvoker / interceptor middlewares (5 each), plus a long tail.

Acceptance:

  • Zero #pragma warning disable under src/ (tests may keep genuinely unavoidable ones, each with a justification comment)
  • PluginBoundary-style filter helper shared across projects that need boundary catches
  • No new .editorconfig severity downgrades introduced as a substitute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

  • Status
    Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions