Skip to content

ci: add mbo-style clang-tidy job + clear production clang-tidy findings (#166) - #412

Merged
helly25 merged 1 commit into
mainfrom
tooling/clang-tidy-batch3
Aug 8, 2026
Merged

ci: add mbo-style clang-tidy job + clear production clang-tidy findings (#166)#412
helly25 merged 1 commit into
mainfrom
tooling/clang-tidy-batch3

Conversation

@helly25

@helly25 helly25 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Adds a clang-tidy CI job mirroring helly25/mbo's, and clears the remaining production clang-tidy findings so the non-test tree is clean.

clang-tidy CI job (mbo-parity)

  • Builds the compile DB in CI (compile_commands-update.sh, hermetic clang-22 - it records that clang so the commands are parseable by the matching clang-tidy), then runs the clang-tidy pre-commit hook.
  • Scope: sources changed against main on a branch; the whole tree on main (clang-tidy is ~1 TU/50s, so branch runs stay fast).
  • Cache: pulls LLVM each run (not cached, consistent with the sanitizer jobs); persists only a disk cache via a CI-written .bazelrc.user.
  • Wired into the done gate. Report-only for now (continue-on-error on the lint step) while the ~100 test-file findings are swept; building the compile DB still gates (no job-level continue-on-error). Mirrors mbo, which is likewise report-only today.
  • Drops mbo's "Build generated sources" step - xff has no generated headers.

Production findings cleared

  • render.cc - hicpp-signed-bitwise x4: the unsigned char operand promotes to signed int before the hex shift/mask; cast to unsigned.
  • content/line_match.h - drop the redundant {} on two string_view members.
  • cli/plain_backend.cc - NOLINT modernize-return-braced-init-list (a braced {count, ' '} would list-initialize as initializer_list<char> - the std::string gotcha - not repeat the space).
  • ignore/PatternList - NOLINT the deliberate STL-style empty()/size() accessor names.

Local: full //xff/... suite green (92); the four production files are clang-tidy-clean.

Remaining before the gate flip

The ~100 test-file findings (const-correctness, identifier-length/naming, cert-err33-c, unchecked-optional-access, argument-comment, etc.) are now surfaced by the report-only job. Sweeping them is the follow-up that lets us drop continue-on-error and make clang-tidy a hard gate.

…gs (#166)

Adds a clang-tidy CI job mirroring helly25/mbo: it builds the compile DB
(compile_commands-update.sh, hermetic clang-22) and runs the clang-tidy pre-commit
hook, scoped to sources changed against main on a branch and the whole tree on main.
It pulls LLVM each run (not cached, like the sanitizer jobs) and persists only a disk
cache via a CI-written .bazelrc.user. Wired into the "done" gate. Report-only for now
(continue-on-error on the lint step) while the remaining test-file findings are swept;
building the compile DB still gates. Drops mbo's generated-sources step (xff has none).

Production findings cleared so the non-test tree is clang-tidy-clean:
- render.cc: hicpp-signed-bitwise x4 - cast the unsigned-char operand to unsigned (it
  was promoting to signed int) for the hex-digit shift/mask.
- content/line_match.h: drop the redundant braces on two string_view members.
- cli/plain_backend.cc: NOLINT modernize-return-braced-init-list (a braced {count, ' '}
  would list-initialize as initializer_list<char>, the std::string gotcha).
- ignore/PatternList: NOLINT the STL-style empty()/size() accessor names.

Remaining test-file findings (~100) are surfaced by the report-only job and will be
swept before flipping it to a hard gate.
@helly25
helly25 enabled auto-merge (squash) August 8, 2026 21:06
@helly25
helly25 merged commit 493899b into main Aug 8, 2026
10 checks passed
@helly25
helly25 deleted the tooling/clang-tidy-batch3 branch August 8, 2026 21:15
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