Skip to content

Conversation

etwoo
Copy link
Contributor

@etwoo etwoo commented Jul 20, 2025

Fixes #666 (follow up to premature attempt: #980)

In this PR:

  1. add a default .clang-tidy file appropriate for interactive developer use
  2. run clang-tidy under CI

Sidenote: I have not implemented a containerized approach because, unlike clang-format and ./tools/run-clangcldocker.sh, clang-tidy needs to know how the build is configured and what command-line arguments are passed to the compiler. My understanding is that clang-tidy typically has access to this information in one of the following ways:

  • configure with -DCMAKE_CXX_CLANG_TIDY=..., and let cmake run clang-tidy for each *.cpp file, as part of the subsequent build
  • configure with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to generate ./build/compile_commands.json, and then pass this information via the -p argument, like:
jq --raw-output0 .[].file ./build/compile_commands.json | xargs -0 clang-tidy -p ./build/

With either approach, containerization seems to offer little advantage, as clang-tidy is tightly coupled to the rest of the build toolchain regardless (configure-time feature detection, compiler flags, etc).

@anonrig anonrig requested a review from lemire July 20, 2025 23:07
@lemire
Copy link
Member

lemire commented Jul 21, 2025

Running tests.

@etwoo etwoo requested a review from anonrig July 21, 2025 08:07
@anonrig anonrig merged commit 47fcfe5 into ada-url:main Jul 22, 2025
48 checks passed
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.

Integrate clang-tidy
3 participants