Add code quality tooling: clang-tidy, sanitizers, coverage - #3046
Merged
Merged
Conversation
- Export compile_commands.json for tooling - .clang-tidy: clang-analyzer + bugprone + cert checks scoped to src/, with stylistic/false-positive-prone checks disabled - ENABLE_SANITIZERS CMake option (ASan + UBSan) - ENABLE_COVERAGE CMake option with an lcov/genhtml 'coverage' target - CI: asan job (ctest + stress test under ASan/UBSan), clang-tidy job (warning-count ratchet, baseline 29 with pinned clang-tidy-18), coverage job (lcov summary + HTML report artifact) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Adds static analysis, sanitizer, and coverage tooling to the project, all enforced in CI:
.clang-tidy: full clang static analyzer +bugprone-*/cert-*checks, scoped tosrc/(bundled submodules and vendoreduthash.hexcluded). Stylistic / false-positive-prone checks are disabled with rationale in the config.compile_commands.json; newENABLE_SANITIZERS(ASan + UBSan) andENABLE_COVERAGEoptions, plus amake coveragetarget (lcov/genhtml HTML report).tests.yml):asan— ctest + stress test under ASan/UBSanclang-tidy— warning-count ratchet: fails if the count exceedsMAX_WARNINGS(baseline 29, pinned to clang-tidy-18 so runner image upgrades don't shift the number); findings are posted to the job summarycoverage— lcov summary in the job summary + HTML report uploaded as artifactVerification
All three new jobs were rehearsed in an ubuntu:24.04 container matching the CI runners: clang-tidy at exactly 29 warnings, ASan and coverage builds both 12/12 ctest + 3/3 stress-test ciphers. Plain/ASan/coverage builds also pass 12/12 on macOS.
Notes
The 29 baseline clang-tidy findings are pre-existing; several look like real bugs (use-after-free reports in
cache.c/tunnel.c, NULL-deref paths inserver.c/jconf.c). Fixing them and ratchetingMAX_WARNINGSdown is intended follow-up work.🤖 Generated with Claude Code