-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add lint long_variable_names
#14818
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
base: master
Are you sure you want to change the base?
Add lint long_variable_names
#14818
Conversation
The lint is configurable by using `max-variable-name-length`.
r? @llogiq thanks for your clippy workshop today! Looking forward for your feedback. |
I doubt whether the default value is well chosen. 30 seems ok for most of the use cases. But for the clippy source it was needed to create some different configurations too. |
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.
Yeah, so I'd like to make sure that we have some benefit if we actually have that lint warn. I figure we either make it a pedantic lint or we set a far higher default threshold. When in doubt, you can run lintcheck.
Otherwise this looks good to merge.
/// ``` | ||
#[clippy::version = "1.88.0"] | ||
pub LONG_VARIABLE_NAMES, | ||
style, |
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 if we make it warn by default, we better pick a really large threshold. Adding warnings to many folks' CI jobs should have some serious benefit to make up for the hassle. So I'd either make it pedantic (which is allow by default) or set the default absurdly high, e.g. 100, so people who think this is a good idea can introduce tighter bounds to their projects.
The lint is configurable by using
max-variable-name-length
.Partly fixes #644 this PR only concerns the variable length
changelog: [
long_variable_names
]: enable variable length check in clippy