Skip to content

clang-tidy: retune - disable three noisy new-in-22 checks - #407

Merged
helly25 merged 2 commits into
mainfrom
tooling/clang-tidy-retune
Aug 8, 2026
Merged

clang-tidy: retune - disable three noisy new-in-22 checks#407
helly25 merged 2 commits into
mainfrom
tooling/clang-tidy-retune

Conversation

@helly25

@helly25 helly25 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

First step of the #166 finding sweep, on the now-clean clang-tidy-22 parse (#405). A representative sample was dominated by false-positive noise from three new-in-clang-22 checks that fight the codebase's idioms, so they're disabled (trailing relaxations block, alphabetical; rationale in the header prose since the folded Checks: scalar can't hold inline # comments):

  • cppcoreguidelines-pro-bounds-avoid-unchecked-container-access - fires on every operator[] (mbo saw ~80% of findings from just this).
  • readability-use-concise-preprocessor-directives - wants #elifdef over the compound #if defined(...) the code uses deliberately.
  • misc-include-cleaner - under the hermetic libc++ it mis-maps standard headers (flags clearly-used <vector>/<utility> as unused) and doesn't track concept usage. Too many false positives to gate on; if run by hand for an IWYU pass, keep concept-/std-providing headers (// IWYU pragma: keep), don't blindly drop what it flags.

Sample findings dropped from ~27 to ~10 genuine types (math-parentheses, container-contains, str-contains, getenv mt-unsafe, ...) - the fix pass handles those next, then the report-only CI job, then gating. Config-only change; the hook stays stages: [manual].

A clean-parse sample was dominated by false-positive noise, so disable three
new-in-clang-22 checks that fight the codebase's idioms (added to the trailing
relaxations block, alphabetical; rationale in the header prose since the folded
Checks: scalar cannot carry inline comments):

- cppcoreguidelines-pro-bounds-avoid-unchecked-container-access: fires on every
  operator[].
- readability-use-concise-preprocessor-directives: wants #elifdef over the
  compound '#if defined(...)' the code uses deliberately.
- misc-include-cleaner: under the hermetic libc++ it mis-maps standard headers
  (flags clearly-used <vector>/<utility> as unused) and does not track concept
  usage - too many false positives to gate on. If run by hand for an IWYU pass,
  keep concept-/std-providing headers (// IWYU pragma: keep), don't blindly drop.

That leaves ~10 genuine finding types (math-parentheses, container-contains,
str-contains, getenv mt-unsafe, ...) for the fix pass. Config-only; the hook
stays manual.
@helly25
helly25 enabled auto-merge (squash) August 8, 2026 16:44
@helly25
helly25 merged commit c134382 into main Aug 8, 2026
9 checks passed
@helly25
helly25 deleted the tooling/clang-tidy-retune branch August 8, 2026 16:59
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