-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Suppress readability-enum-initial-value in clang-tidy #4540
Suppress readability-enum-initial-value in clang-tidy #4540
Conversation
cc: @jonmeow |
This warns unhelpfully on enums like: ``` enum Kind: int8_t { Value, ValueOrRef, ... FullInitializer, Last = FullInitializer }; ``` It claims that all enum values should have explicit values if any of the values do, but that's not what we would want to write here.
b57f9f7
to
f26e26d
Compare
-readability-function-cognitive-complexity, -readability-else-after-return, | ||
-readability-identifier-length, -readability-implicit-bool-conversion, | ||
-readability-magic-numbers, -readability-make-member-function-const, | ||
-readability-else-after-return, -readability-enum-initial-value, |
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've been trying to document why various warnings are disabled so that we don't forget. Can you add a note above, something like:
# - readability-enum-initial-value has false positives for `Last = ...`.
(it can't be here due to yaml parsing)
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.
Oh yes, thanks. I didn't notice the comments up there.
Thanks! |
This warns unhelpfully on enums like:
It claims that all enum values should have explicit values if any of the
values do, but that's not what we would want to write here.