From ac21a8d3a752f6f0e1440434cd1aea6c616d88e1 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Mon, 17 Feb 2025 09:25:12 +0100 Subject: [PATCH] clang-tidy: Ignore the external directory The external directory contains code for external librairies. It should not be inspected by clang-tidy. The regex syntax does not allow to directly ignore a directory. Solve this issue by adding a `clang-tidy` config file in the external directory which disables all the checks. See: https://stackoverflow.com/questions/74349432/clang-tidy-exclude-specific-dir-from-analysis See: https://stackoverflow.com/questions/58338202/cmake-clang-tidy-disable-checking-in-directory See: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/777/diffs --- .clang-tidy | 1 + external/.clang-tidy | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 external/.clang-tidy diff --git a/.clang-tidy b/.clang-tidy index ebf09e31a09..30c2c87ad27 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1 +1,2 @@ Checks: 'bugprone-*,-bugprone-easily-swappable-parameters,-bugprone-virtual-near-miss,-bugprone-suspicious-include' +HeaderFilterRegex: '' diff --git a/external/.clang-tidy b/external/.clang-tidy new file mode 100644 index 00000000000..05d9ccc2663 --- /dev/null +++ b/external/.clang-tidy @@ -0,0 +1,4 @@ +# clang-tidy does not allow easy deactivation of a directory. +# Use a dummy .clang-tidy file that disables all clang-tidy checks except one that will never match. +# This one check is necessary; clang-tidy reports an error when no checks are enabled. +Checks: '-*,llvm-twine-local'