-
Notifications
You must be signed in to change notification settings - Fork 144
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
fix: exclude etag from field_behavior lints #1009
Conversation
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 think I would rather have a const etagFieldName = "etag"
and have all of the !excludeFields.Contains(f.GetName())
just be f.GetName() != etagFieldName
rather than having a stringset
with one value, imho.
I don't have another example of another standard field, but I can imagine there might be others, which is why I started with |
Ack. Agreed. Can we change the variable name to |
Done! |
I am not sold on the standardFields name. It doesn't seem to describe the intended usage. |
The variable name for a thing should say what it is and the behavior or how it is used should be demonstrated by the code, in this case, |
I'm going to merge this. The variable name can be discussed here and updated in another PR if necessary. |
@shwoodard So we have named it standardFields? What are standard fields? "StandardFields" gives the reader no indication what this variable is going to be used for, I think making someone read the implementation to figure out what a variable is used for is |
The
etag
field should be excluded from the AIP-203 rules, because it is not supposed to be given any behavior annotations per AIP-154.Fixes #977.
In a separate PR perhaps we should add a rule to enforce that
etag
should not have any field_behavior annotations at all.