How to prevent clang-tidy to check sources added with FetchContents?

But with a big difference: Normally you will compile the extern sources under build/_deps. But you must not check them!

Simply use i.e.: run-clang-tidy -p build sources examples tests

Just dump a .clang-tidy file in the _deps directory that disables all tests.

Works with whatever way you invoke clang-tidy and even in IDEs.

I also do that for the build folder to exclude generated files.

That’s a clever idea, how did you integrate that with cmake?

NOTE: You have to remove or override all existing .clang-tidy files too!