[PATCH] D34654: Allow passing a regex for headers to exclude from clang-tidy

Laurent Nicolas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 15 21:58:36 PST 2018


lonico added a comment.



> The second way to handle this use case is possible on a different level: one can run clang-tidy over the whole project with `-header-filter=.*` and then filter the results and use a specialized tool to display them, e.g. https://github.com/Ericsson/codechecker. I'm not sure though whether this suits your needs or is an overkill.

This approach does not work for us, as our external headers generate a lot of warnings.  It's not so much the warnings that are an issue, but generating the notes is taking a lot of time.  We implemented this patch in our local installation, and it dramatically reduces the time it takes to run clang-tidy on a "component", where we can focus on the source and header files in a subdirectory tree, and exclude headers from other subdirectories.  In the worst case, we're really comparing 1 hour to a few minutes.

Even the first approach is not so interesting, as we would like warnings for another subdirectory tree to be visible in this subdirectory.   What we really want is to be able to segregate warnings per component (a subdirectory tree) and don't bother people who import headers from other subdirectory trees with local warnings.  So the owner of a subdirectory tree should see all warnings for their tree, but consumers of headers should not be bothered.


Repository:
  rL LLVM

https://reviews.llvm.org/D34654





More information about the cfe-commits mailing list