I'm running clang-tidy on a header file header.h. However as some of the warning outputs, it's outputting system headers:
.../include/c++/8/bits/std_abs.h:46:8: error: expected identifier or '(' [clang-diagnostic-error]
extern "C++"
../include/c++/8/cctype:62:1: error: unknown type name 'namespace' [clang-diagnostic-error]
namespace std
../include/c++/8/cctype:62:14: error: expected ';' after top level declarator [clang-diagnostic-error]
namespace std
..
etc
The problem: I don't want to see the warnings for anything other than the source file I'm scanning, for either a source file or header file.
I've tried implementing the fix here (What is the correct way of providing header-filter for clang-tidy in Cmake?) using --header-filter
but it didnt work. I added the path to the header file that I was scanning in the regex, but I was still seeing the system header warnings.