[PATCH] D90282: [clang-tidy] Add IgnoreShortNames config to identifier naming checks

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 19 06:42:41 PST 2020


aaron.ballman added a comment.

In D90282#2395956 <https://reviews.llvm.org/D90282#2395956>, @smhc wrote:

> I updated it to use XXShortSizeThreshold.
>
> But I was thinking.. perhaps a more generic approach could be "xxIgnoreRegex", this would allow you to do things such as :
>
> VariableIgnoreRegex: ([a-z]{2}|index)
> ClassIgnoreRegex: (Special_CASE|CommonOther.*)
> etc.
>
> it would be more generic while also allowing for excluding short names.

I don't have a strong opinion on that approach. It would be a more flexible approach and that's appealing, but it also means writing regular expressions which is a bit unappealing because those aren't obvious to everyone and it's unclear what the performance characteristics would be of running those regexes on every identifier in the program. I'm curious if @alexfh or @njames93 (or others) have opinions on this.


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

https://reviews.llvm.org/D90282



More information about the cfe-commits mailing list