[PATCH] D90282: [clang-tidy] Add IgnoreShortNames config to identifier naming checks
Shane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 19 20:13:11 PST 2020
smhc added a comment.
Regexes may be a bit of a slippery slope as any identifier scheme could be represented as a regex (casing, prefix, suffix etc) but it's not practical to provide a fix or suggestion with a regex.
For example with a 'ShortThreshold' a fix could offer to change the casing/xffix or to trim the variable length. With a regex it's less about making a naming rule and more about providing a workaround for problematic edge cases. As such should be used sparingly.
I think the difficulty in writing them is not too much of a deal breaker. Providing an example for the equivalent config options would be just as useful as the config option itself. e.g
"For example, to ignore names with a length less than 3 use: \w{1,3}' "
I assume the ^ and $ would be implied by the matcher. If they want anything more complex they'd be effectively asking for regex support anyway.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90282/new/
https://reviews.llvm.org/D90282
More information about the cfe-commits
mailing list