4

I'm trying to run clang-tidy on a big project with a lot of files that include third party libraries:

#include "third_party/..."

And thus I receive a lot of errors corresponding to these third party libraries. Adding NOLINT to each include is not an option since the project is large (and it seems that it doesn't work).

I tried to use -header-filter, but I still receive errors from third party libraries.

clang-tidy -header-filter='-third_party' "${SOURCE_FILES[@]}"

Is it possible to exclude third_party/* from checks?

Ivan
  • 139
  • 1
  • 10

1 Answers1

3

You should flag these headers as system headers.

You can do this via

#pragma clang system_header

These headers will get ignored by clang-tidy and will produce no warnings.

  • 3
    Is it the only way? Because I don't own the library that is being downloaded to the `third_party/`. – Ivan Feb 07 '20 at 10:35