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

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 25 15:26:35 PDT 2021


alexfh added a comment.

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?


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