Skip to content

Commit f8323d2

Browse files
authored
fix: correct clang-tidy HeaderFilterRegex to match Posix ERE (#310)
`HeaderFilterRegex` is a whitelist to determine info of which header file will be reported by clang-tidy. ``` --header-filter=<string> - Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. Can be used together with -line-filter. This option overrides the 'HeaderFilterRegex' option in .clang-tidy file, if any. ``` Previous config `HeaderFilterRegex: '(?!_deps)(src|test|example)'` can filter `build/_deps/nlohmann_json-src`, but it is an illegal syntax in clang-tidy's regex engine. It seems that clang-tidy doesn't support negative lookahead. Forgive me for using 'seems', I have only found too little information about clang-tidy's regex syntax. And in fact I still haven't figured out how it works. And there are also some bugs in clang-tidy, see llvm/llvm-project#138302. Clang-tidy 19 supports a new feature `ExcludeHeaderFilterRegex` but we use version 18 as default. So we can only find another way to filter `build/_deps/nlohmann_json-src`.
1 parent 3b59ef2 commit f8323d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ CheckOptions:
3939
- key: readability-identifier-naming.ProtectedMemberSuffix
4040
value: '_'
4141

42-
HeaderFilterRegex: '(?!_deps)(src|test|example)'
42+
HeaderFilterRegex: 'src/iceberg|example'

0 commit comments

Comments
 (0)