-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make struct_field_names
check private fields of public structs.
#14076
Conversation
struct_name_repetitions
check private fields of public structs.struct_field_names
check private fields of public structs.
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.
Consider viewing the diff with whitespace ignored.
Thanks!
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.
Thanks !
Will merge when CI passes |
Currently, If a struct is `pub` and its field is private, and `avoid-breaking-exported-api = true` (default), then `struct_field_names` will not lint the field, even though changing the field’s name is not a breaking change. This is because the breaking-exported-api condition was checking the visibility of the struct, not its fields (perhaps because the same code was used for enums). With this change, Clippy will check the field’s effective visibility only. Note: This change is large because some functions were moved into an `impl` to be able to access more configuration. Consider viewing the diff with whitespace ignored.
Fixed. Sorry for the delay; I understood this comment as “I am going to merge this once a CI run completes” and did not realize that you were telling me that I needed to check on the failures. |
Currently, If a struct is
pub
and its field is private, andavoid-breaking-exported-api = true
(default), thenstruct_field_names
will not lint the field, even though changing the field’s name is not a breaking change. This is because the breaking-exported-api condition was checking the visibility of the struct, not its fields (perhaps because the same code was used for enums). With this change, Clippy will check the field’s effective visibility only.Note: This change is large because some functions were moved into an
impl
to be able to access more configuration. Consider viewing the diff with whitespace ignored.changelog: [
struct_field_names
]: also check private fields of public structs