Skip to content

Add code quality tooling: clang-tidy, sanitizers, coverage - #3046

Merged
madeye merged 1 commit into
masterfrom
feature/code-quality-tooling
Jul 15, 2026
Merged

madeye merged 1 commit into
masterfrom
feature/code-quality-tooling

Conversation

@madeye

@madeye madeye commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 to src/ (bundled submodules and vendored uthash.h excluded). Stylistic / false-positive-prone checks are disabled with rationale in the config.
  • CMake: always export compile_commands.json; new ENABLE_SANITIZERS (ASan + UBSan) and ENABLE_COVERAGE options, plus a make coverage target (lcov/genhtml HTML report).
  • CI (three new jobs in tests.yml):
    • asan — ctest + stress test under ASan/UBSan
    • clang-tidy — warning-count ratchet: fails if the count exceeds MAX_WARNINGS (baseline 29, pinned to clang-tidy-18 so runner image upgrades don't shift the number); findings are posted to the job summary
    • coverage — lcov summary in the job summary + HTML report uploaded as artifact

Verification

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 in server.c/jconf.c). Fixing them and ratcheting MAX_WARNINGS down is intended follow-up work.

🤖 Generated with Claude Code

- 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>
@madeye
madeye merged commit ba7b9ad into master Jul 15, 2026
8 checks passed
@madeye
madeye deleted the feature/code-quality-tooling branch July 15, 2026 04:26
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