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

Mateusz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 28 03:58:52 PDT 2021


Ashimaru added a comment.

In D34654#3022728 <https://reviews.llvm.org/D34654#3022728>, @alexfh wrote:

> Repeating my question from an earlier comment: would a header glob list (similar to how the format of the `-checks=` flag) be enough for the use cases folks have? On the one hand glob list doesn't support all the features of regular expressions, but are they all useful for matching paths? Glob list in clang-tidy currently supports set union (similar to regex `|`) and <any subsequence> - `*` (regex `.*`). If needed, the support can be expanded with `?`, character classes, character ranges and/or other features of POSIX globs (https://man7.org/linux/man-pages/man7/glob.7.html). On the flipside, glob list has a cleaner syntax (no need to quote characters common in paths - like `.`), and allows to easily express exclusion of subsets. It should be a convenient tool to represent a set of files / directories. In comparison to the proposed header-filter + exclude-header-filter glob list makes it possible to naturally express restrictions similar to "everything under a/ (except for everything under a/b/ (except for everything under a/b/c/))" - `a/,-a/b/,a/b/c/`.
>
> What do folks think?

Yes in my case this would be enough :)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D34654/new/

https://reviews.llvm.org/D34654



More information about the cfe-commits mailing list