ci: add mbo-style clang-tidy job + clear production clang-tidy findings (#166) - #412
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
compile_commands-update.sh, hermetic clang-22 - it records that clang so the commands are parseable by the matching clang-tidy), then runs theclang-tidypre-commit hook.mainon a branch; the whole tree onmain(clang-tidy is ~1 TU/50s, so branch runs stay fast)..bazelrc.user.donegate. Report-only for now (continue-on-erroron the lint step) while the ~100 test-file findings are swept; building the compile DB still gates (no job-levelcontinue-on-error). Mirrors mbo, which is likewise report-only today.Production findings cleared
render.cc-hicpp-signed-bitwisex4: theunsigned charoperand promotes to signedintbefore the hex shift/mask; cast tounsigned.content/line_match.h- drop the redundant{}on twostring_viewmembers.cli/plain_backend.cc- NOLINTmodernize-return-braced-init-list(a braced{count, ' '}would list-initialize asinitializer_list<char>- thestd::stringgotcha - not repeat the space).ignore/PatternList- NOLINT the deliberate STL-styleempty()/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-errorand make clang-tidy a hard gate.