Skip to content

Commit ac21a8d

Browse files
committed
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
1 parent f028ef1 commit ac21a8d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Checks: 'bugprone-*,-bugprone-easily-swappable-parameters,-bugprone-virtual-near-miss,-bugprone-suspicious-include'
2+
HeaderFilterRegex: ''

external/.clang-tidy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# clang-tidy does not allow easy deactivation of a directory.
2+
# Use a dummy .clang-tidy file that disables all clang-tidy checks except one that will never match.
3+
# This one check is necessary; clang-tidy reports an error when no checks are enabled.
4+
Checks: '-*,llvm-twine-local'

0 commit comments

Comments
 (0)