Commit f8323d2
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
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
0 commit comments