-
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
Unseparated literal suffix #7726
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
Not sure what's happening there at https://github.com/rust-lang/rust-clippy/runs/3717748423#step:5:12 |
The log states:
The correlating text inside
https://github.com/rust-lang/rust-clippy/blame/master/CHANGELOG.md#L2407 However, I'm not sure what causes the warning in this case. |
Ah, there is a
https://github.com/rust-lang/rust-clippy/runs/3718070585#step:6:9 Not sure what's the best way to get around it. We can probably remove all old links to |
Actually I think I would prefer having two lints over adding a config option for these "one or the other" scenarios. And this would avoid a lint rename. |
This also crossed my mind. The only downside of this approach is that someone might get confused as to why two different and opposing lints co-exists. Maybe a documentation for the two lints can describe this, but I'm open to suggestions. |
Yes the docs should absolutely mention the other lint. |
☔ The latest upstream changes (presumably #7673) made this pull request unmergeable. Please resolve the merge conflicts. |
c7da7d6
to
21137cd
Compare
846a943
to
b25c59f
Compare
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.
Sorry for not reviewing this for so long! Only a few comments.
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.
LGTM, Thanks! Please squash your commits and this is ready to merge.
`unseparated_literal_suffix` This commit adds a configuration `literal-suffix-style` to enforce a specific style for unseparated_literal_suffix. The configuration accepts two values: - "separated" enforce all literals to be written separately (e.g. `123_i32`) - "unseparated" enforce all literals to be written as unseparated (e.g. `123i32`) Not specifying a value means that there is no preference on style and any style should not be warned.
23f5736
to
bb1cf72
Compare
@flip1995 squashed 🙂 |
@bors r+ Thanks! |
📌 Commit bb1cf72 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Generally it's better to write 10_u8, it allows to tell apart better the value from the type. |
Closes #7658
Since
literal_suffix
style is opinionated, we should disable by default and only enforce if it's stated as so.changelog: [
unseparated_literal_suffix
] is renamed toliteral_suffix
, adds a new configurationliteral-suffix-style
to enforce a certain style writing literal_suffix. Possible values forliteral-suffix-style
:"separated"
,"unseparated"