Add clang-tidy, codespell, and sanitizer checks to CI pipeline

Summary

Adds new CI checks across MR and nightly pipelines.

MR pipeline (advisory, allow_failure: true)

  • clang-tidy: Diff-based semantic analysis on changed files with a conservative check set tuned for template-heavy math code. Includes a runner script that generates driver .cpp files for header-only Eigen modules so InternalHeaderCheck.h doesn't error out.
  • codespell: Catches common misspellings in comments, strings, and identifiers. Config in setup.cfg for compatibility with codespell 2.2.6 on Alpine 3.20.
  • ASAN+UBSAN smoke tests: Combined address and UB sanitizer build+test with reduced parallelism (2 jobs) and per-test timeouts. Leak detection disabled to prevent LSan exit-time hangs. Uses -fno-sanitize-recover=address so ASAN errors abort but pre-existing UBSAN issues only warn. Compiled with -fno-omit-frame-pointer and run with print_stacktrace=1 and llvm-symbolizer for symbolized stack traces.

Nightly pipeline (full test suite)

  • Full ASAN+UBSAN (clang-19, ubuntu:24.04): Single combined build and test for Official + Unsupported with -fsanitize=address,undefined. Compiled with -fno-omit-frame-pointer; tests run with print_stacktrace=1 in both ASAN_OPTIONS and UBSAN_OPTIONS, and ASAN_SYMBOLIZER_PATH set to llvm-19's llvm-symbolizer for fully symbolized stack traces. 2000s test timeout for ~2x sanitizer overhead. Leak detection disabled. UB sanitizer errors are non-recoverable (-fno-sanitize-recover=undefined).

All MR checks are advisory (allow_failure: true) to avoid blocking existing workflows. All sanitizer runs (both MR smoke and nightly) produce symbolized stack traces via -fno-omit-frame-pointer, print_stacktrace=1, and llvm-symbolizer.

Files changed

File Change
.clang-tidy New — project-root clang-tidy config
setup.cfg New — codespell config with skip paths and ignore list
ci/scripts/run-clang-tidy.sh New — diff-based clang-tidy runner for header-only code
ci/checkformat.gitlab-ci.yml Added clang-tidy and codespell CI jobs
ci/build.linux.gitlab-ci.yml Added combined ASAN+UBSAN builds (MR smoke + nightly)
ci/test.linux.gitlab-ci.yml Added combined ASAN+UBSAN tests (MR smoke + nightly) with symbolized stack traces
ci/scripts/test.linux.script.sh Made parallelism overridable via EIGEN_CI_CTEST_PARALLEL

Test plan

  • Verify clang-tidy job runs on MR and reports issues on changed files
  • Verify codespell job runs and completes cleanly
  • Verify combined ASAN+UBSAN smoke tests build and run with reduced parallelism
  • Verify nightly combined ASAN+UBSAN full test suite runs with symbolized stack traces

🤖 Generated with Claude Code

Edited by Rasmus Munk Larsen

Merge request reports

Loading