3

I would like to exclude third party header files from being checked by clang-tidy.

From what I can tell, using a negative regular expression for header file exclusion is never going to happen: https://reviews.llvm.org/D34654

Slapping // NOLINT on a header file inclusion. This does not work:

#include "third_party.h"    // NOLINT

From what I can tell, there is no line-range option that can be used to say "Ignore all lines in this file" (please correct me if I am wrong).

What is the simplest method for excluding third party header files from being analyzed by clang-tidy?

natersoz
  • 1,674
  • 2
  • 19
  • 29
  • 3
    I *think* you are looking for `-isystem`. – Jesper Juhl Apr 30 '19 at 16:36
  • That was part of the solution, thanks. My frustration with this tool boiled over into my previous comment. If you're dedicated to using this tool some amount of 3rd part library modification or nuanced replacement will be necessary. The results are worth it. The integration is tedious. – natersoz May 05 '19 at 16:15
  • Tedious? I don't agree. I've integrated clang-tidy into several code bases (the current one being ~500k lines of code). I've always found it to be fairly easy to do so. But, of course, opinions and experiences differ. – Jesper Juhl May 05 '19 at 16:18
  • 3
    @JesperJuhl clang-tidy's interface is completely broken, and this kind of issues are a clear example of it. – Martin Feb 17 '21 at 17:06

0 Answers0