Skip to content

fix(csharp): qualify S2178 parenthesized Boolean operands - #949

Open
wakemeup0 wants to merge 5 commits into
fix/smoke-csharp-s2178-operand-message-20261015from
fix/smoke-csharp-s2178-parenthesized-operands-20261015
Open

wakemeup0 wants to merge 5 commits into
fix/smoke-csharp-s2178-operand-message-20261015from
fix/smoke-csharp-s2178-parenthesized-operands-20261015

Conversation

@wakemeup0

@wakemeup0 wakemeup0 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Correct 20 captured supplemental C# S2178 parenthesized operand gaps. Preserve short wording for parenthesized identifiers and unknown logical facts; use runtime advice only for two direct explicitly witnessed Boolean identifiers.

Change type and scope

Bug fix for csharpsquid:S2178. Changes are limited to the private rule and its existing actual CLI regression target. Parentheses are checked within 64 visits; casts, comments, malformed wrappers and exhausted depth are refused. Existing bare shapes and binding/call guards are retained.

Related issues

Direct smoke-campaign request to fix findings and publish; no standalone issue or closure is claimed. Depends on published PR947 at c544670f99cceb193dcda152d903ac1881fa87f9.

Verification

Independent source and frozen-evidence review approved this exact signed head without actionable findings. The review verified signed source inventories, unchanged committed regression bytes, executed behavioral red/green evidence, complete ordered report comparisons and fresh CLI witnesses. Independent review receipt SHA256: ae913bb6d417188ea4d06386855417f5671c8063cf8ebc7892cf99f296924c02. All 21 exact-head hosted checks and dependency-base restoration remain publication gates.

Signed unchanged-production tests-only 2e68aa503ef7a4131c5a2658b52be37036206980 produced genuine compiled unit and actual CLI assertion failures (both exit 101). Identical test bytes pass at signed final 33106d24ef90aee25baa57be809a946bdcec6a78.

  • csharp_s2178_cli_complete_typed_lf and csharp_s2178_cli_complete_typed_unicode_crlf: all 20 captured reference instances across both layouts, full target objects and whole documents.
  • s2178_parenthesized_*_full_objects and csharp_s2178_cli_parenthesized_complete_native_*: both operators, left, right and nested wrappers, mixed logical Unknown/refusal, nearest callable, condition contexts, comments/errors and exact 64-visit and fact-depth boundaries.
  • csharp_s2178_cli_parenthesized_malformed_documents: full diagnostics/incomplete exit 2 preserved.
  • csharp_s2178_cli_logical_cache_runtime_mixed_restored_documents: same path/cache runtime-to-mixed-to-restored documents with source bytes checked around every call.
  • cargo test --locked --jobs 1 -p hoonarqube-csharp --all-targets --all-features -- --test-threads=2: 1905 passed.
  • Dedicated actual CLI target: 11 passed; 14 inherited CLI targets:98 passed.
  • Strict affected all-target/all-feature Clippy, formatting and diff checks and locked CLI build passed.
  • Released 0.3.1 implicit-default Docker dogfood: zero rust:S3776.
  • All 50 root-qualified complete reports, 6 preserved cache documents, 16 new native documents and 6 new logical cache documents match. 42 root report streams remain byte-identical; all 1,136 original/current input pins remain unchanged.

Local evidence: /Users/wakemeup/.codex/artifacts/hoonarqube-repairs-20261013/csharp-s2178-parenthesized-operands. Exact test-symbol map: acceptance-to-test-symbols.json; captured command, exit, stdout and stderr receipts: runs/; immutable final binary binding: final-binary-binding.json. Independent root review completed before publication. All 21 exact-head hosted checks and intended dependency-base restoration remain publication gates.

The PR initially targeted main to obtain all 21 successful checks from the repository’s GitHub default CodeQL setup. The intended dependency base is now restored to fix/smoke-csharp-s2178-operand-message-20261015. Publication verifies the unchanged signed head, full body and exact-head hosted check rollup against that base.

Compatibility and risks

Each typed layout now has 151 issues / 44 S2178 targets / 22 long, 22 short; all 260 existing native target objects and their order are retained. Added logical facts are restricted to direct Boolean identifier pairs or valid literal pairs; all mixed, wrapped, nested, call, comparison and unary logical children remain Unknown/short. Original RHS fact depth is retained. The existing native-only parenthesized comparison gains one long finding per layout; this is a native consequence without exact-source reference capture. Catalog, profiles, parser, cache, quickfix and suppression behavior are unchanged.

Limitations

Captured reference is SonarAnalyzer.CSharp 10.33.0.0 (MVID d48c9fe2-34cd-423f-9779-cb2b06ac7d54). No new server/reference run or original project detection repair is claimed. New native controls do not establish additional reference parity. Standalone C# semantic context remains missing/incomplete. The two actual cast-shaped native selections remain absent; this is native parser refusal, not reference parity or clean semantic proof. Full S2178, SonarQube, Enterprise or security parity is unclaimed. Publication and all 21 hosted checks belong to root; no merge, tag or release is requested by this package.

@wakemeup0
wakemeup0 changed the base branch from main to fix/smoke-csharp-s2178-operand-message-20261015 October 15, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant