-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a regex style pattern to the enum-name-style #2210
Add a regex style pattern to the enum-name-style #2210
Conversation
e917d63
to
6f6c4a1
Compare
"and end with '_t' or '_e'.", | ||
"Checks that enum type names follow a naming convention defined by " | ||
"a RE2 regular expression.\n" | ||
"Example common regex patterns:\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of repeating the same examples in various places using regexps, how about we add a little section in the lint README.md with regexp examples and just add a link here ?
(also here, the default regex, the one with the trailing _e or _t is not even mentioned)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem.
configuration, {{"style_regex", SetRegex(&style_regex_)}}); | ||
if (!s.ok()) return s; | ||
|
||
violation_message_ = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering: instead of having a validation_message_ member that we most likely never use, yet allocate and prepare should we maybe have a std::string CreateValidationMessage() {}
that creates it on-the-fly if needed in the actual valdation ? It also would mean that we don't have to duplicate the code creating it in the constructor and in the Configure()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem.
be5d5cf
to
9c50c4b
Compare
Cleaned up the violation message (remove code duplication).
9c50c4b
to
fa735dd
Compare
Adding regex to the enum-name-style rule, part of issue #2074