[cfe-dev] clang-tidy how to exclude header from being preprocessed -- NOLINT not working

Roman Lebedev via cfe-dev cfe-dev at lists.llvm.org
Thu May 3 02:11:17 PDT 2018


On Thu, May 3, 2018 at 11:47 AM, Oza, Hiral via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> Greetings!
>
>
>
> How to exclude #include-ed header files while running clang-tidy? Tried ‘//
> NOLINT’ and ‘// NOLINTNEXTLINE’ but it didn’t help!!!
>
>
>
> Sample program:
>
> a.h:
>
> 01 #include <inc1.h>
>
> 02 #include <inc2.h>
>
> 03 #include “inc3.h>
>
> // other code
>
>
>
> a.c:
>
> 01 #include <a.h> // NOLINT
>
> // other code
>
>
>
> With above sample, I want to skip tidy-ing a.h and I tried placing ‘//
> NOLINT’ but tidy is still parsing a.h.
It can't not parse it. Are you asking about not issuing diagnostics from it?

> I also tried with ‘// NOLINTNEXTLINE’ but still tidy is considering a.c:01
> line and impacts the overall performance.

I would guess as per http://clang.llvm.org/extra/clang-tidy/
you should try using -header-filter=<string>

> Thanks,
Roman.

> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list