[cfe-users] Trouble with the right value for HeaderFilterRegex

Sebastian Kolbe via cfe-users cfe-users at lists.llvm.org
Mon Feb 11 23:18:34 PST 2019


Hi,
 
I can't get HeaderFilterRegex to work. It always expands to the build path where the compile commands are. What's the error?
 
My parameters are:
 
"c:\Program Files\LLVM\bin\clang-tidy.exe" --version
LLVM (http://llvm.org/):
  LLVM version 7.0.1
  Optimized build.
  Default target: x86_64-pc-win32
  Host CPU: haswell
 
CMake based project in "c:\Project" which is build in "c:\Build". The .clang-tidy file is in "c:\Project".
 
If I run
 
c:\Python\python37\python.exe "c:\Program Files\LLVM\share\clang\run-clang-tidy.py" -clang-tidy-binary "c:\Program Files\LLVM\bin\clang-tidy.exe" -p c:\Build
 
(inside c:\Project) I always get
 
c:\Program Files\LLVM\bin\clang-tidy.exe -header-filter=^c:\Build/.* ...
 
regardless which value I try in HeaderFilterRegex. Examples

HeaderFilterRegex: '.*'
HeaderFilterRegex: 'Common/.*'


By altering the "Checks" at the .clang-tidy file I had make sure it is actually loaded.

What I want is that HeaderFilterRegex expands to "c:\Program Files\LLVM\bin\clang-tidy.exe -header-filter=Common/.*".
(If I explicitly call

c:\Python\python37\python.exe "c:\Program Files\LLVM\share\clang\run-clang-tidy.py" -clang-tidy-binary "c:\Program Files\LLVM\bin\clang-tidy.exe" -p c:\Build -header-filter=Common/.*

it behaves how I want it to.)



So, can you give me a hint what I am doing wrong? What value must HeaderFilterRegex have?


Thanks
Sebastian



More information about the cfe-users mailing list