Skip to content
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

complain if all fields of a struct have the same prefix or postfix #2555

Closed
oli-obk opened this issue Mar 19, 2018 · 2 comments · Fixed by #11496
Closed

complain if all fields of a struct have the same prefix or postfix #2555

oli-obk opened this issue Mar 19, 2018 · 2 comments · Fixed by #11496
Assignees
Labels
A-lint Area: New lints L-style Lint: Belongs in the style lint group T-AST Type: Requires working with the AST

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Mar 19, 2018

We already do this for enum variants. The code should be reusable

@oli-obk oli-obk added T-AST Type: Requires working with the AST A-lint Area: New lints L-style Lint: Belongs in the style lint group labels Mar 19, 2018
@rcoh
Copy link
Contributor

rcoh commented Apr 7, 2018

giving this a try

@jonboh
Copy link
Contributor

jonboh commented Aug 30, 2023

@rustbot claim

bors added a commit that referenced this issue Oct 17, 2023
add lint for struct field names

changelog:
[`struct_field_names`]: lint structs with the same pre/postfix in all fields or with fields that are pre/postfixed with the name of the struct.

fixes #2555

I've followed general structure and naming from the code in [enum_variants](https://github.com/rust-lang/rust-clippy/blob/b788addfcc955368b9771b77d312c248fab60253/clippy_lints/src/enum_variants.rs) lint, which implements the same logic for enum variants.
bors added a commit that referenced this issue Oct 18, 2023
add lint for struct field names

changelog: [`struct_field_names`]: lint structs with the same pre/postfix in all fields or with fields that are pre/postfixed with the name of the struct.

fixes #2555

I've followed general structure and naming from the code in [enum_variants](https://github.com/rust-lang/rust-clippy/blob/b788addfcc955368b9771b77d312c248fab60253/clippy_lints/src/enum_variants.rs) lint, which implements the same logic for enum variants.
@bors bors closed this as completed in fe21991 Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints L-style Lint: Belongs in the style lint group T-AST Type: Requires working with the AST
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants