-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add alias 'nonstandard_style' for 'bad_style' #41646
Comments
(Actual name of alias very bikesheddable, I just picked the first thing that came to mind.) |
Bikeshed: "relaxed_style" sounds good. |
"bad_style" sounds better than "nonstandard_style" because "nonstandard" sounds un-opinionated. The point of a "bad_style" annotation is to help people feel guilty. |
Right, I'm questioning if that's a good thing. Do we need to? Even nonstandard_style (or in general, any warning-allow) does make you feel guilty, bad_style is just very much like a shaming and feels bad. |
Her talk was great. I think using something like relaxed_style or permissive_style would be a better choice then bad_style |
I think that 'any_style' is short and is not passive aggressive at all :) |
marking as both @rust-lang/compiler and @rust-lang/lang ; not sure who this falls under, really. Also nominating for discussion; I'm not sure if this requires an RFC or not. |
As one of the heaviest users of |
i have no opinion on what we alias it as, but i would be very interested in an alias that is less shame-y. i am also very happy to implement once we decide what a good alias is! |
For those readers who (like me) were not familiar with the I'm in favor of renaming. I like Regarding whether this ought to have an RFC -- I could go either way; if we opt for no RFC, then we ought to at least do a "mini-FCP" here in the issue. TBH I'm not sure what team has ownership of lints though. =) I guess @rust-lang/lang? |
I definitely don't feel this needs an RFC. I also wholeheartedly agree that we should change the name.
|
Do we really want the "alternative facts" connotation? I can already see someone writing that awful snark and the HN frontpage it'll hit and I'd really rather not have it. |
Heh, I hadn't realized that the term "alternative" had gotten quite so poisoned! Anyway my preferences here aren't very strong. |
I'm happy with any non-judgmental name, we can FCP the PR (I also don't care if we don't) |
FWIW I like the
If something I'm worried there's too much friction for even minor deviations; I don't think I'll ever use rustfmt, for example. |
Given that this comes up often in code translators (such as corrode), and potentially in binding generators as well, then having a more neutral alias for this seems appropriate. I also don't think adding an alias needs an RFC. I'm not going to add to the bikeshedding on the name itself. 🚳 |
I prefer |
As someone who has been annoyed by some C++ codebases that despite having official casing rules use different casing styles in parallel (including libraries using different casing styles), I am glad of those checks to be in the compiler and default on, because they create consistency. I believe this wish of consistency in this issue to be universal, so this isn't just a style issue where everyone can have its own, as your choice of casing gets forced upon the users of your library as well. I use tabs in my codebase and am writing This check has many positive side effects. Like when reading code, you get accustomed to differentiate things inside lists of Looking at the issue from the other perspective, renaming the lint to Also, for beginners its important to see that the style they are doing is not fine, but rather something that is bad for the community of crates, especially their users, due to the inconsistency to the other crates on crates.io. Overall though I don't feel very strongly about a rename, as long as the lint stays a warning by default. |
No more than Beginners already see that the style is not great. This is just about making it possible to design your own beginner experience without feeling bad about it. This doesn't change the warning's existence, it just changes the name so that it isn't discouraging when disabled. |
One example for how the snake case style helps you to identify a bug: https://is.gd/XArdpj You need to look twice to see that the last case in the match is creating a new variable instead of being an actual enum variant. |
@est31 I find this example rather contrived (it switches off multiple layers of safety and imports the matching shorthand). Sure, "nonstandard_style" brings you half-way there, but the option is in the compiler and supported, this discussion is about an alias only. |
@rfcbot fcp merge I agree we don't need an RFC. I'm moving that we agree to change the name to |
Its not a contrived example: I have encountered it in one of my programs. Luckily I had the
No, its about deprecation as well, and probably a Rust 2.0 or something will remove the name. |
Most lints prevent bugs. That isn't an argument for giving it a name like that.
deprecating the name, not the lint. |
This was fixed in #48386 (looks like we forgot to unlock) |
@Manishearth #48386 has a comment from you saying that it doesn't fix this issue completely, reopening because I don't see any other linked PRs |
Oops, sorry!!
…On Wed, Aug 29, 2018, 9:10 AM Carol (Nichols || Goulding) < ***@***.***> wrote:
Reopened #41646 <#41646>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABivSK6jlQgnCk31NbUAIde7vYmvCI9Kks5uVrzWgaJpZM4NMg4Q>
.
|
`bad_style` is being deprecated in favor of `nonstandard_style`: - rust-lang#41646
…shearth Replace usages of 'bad_style' with 'nonstandard_style'. `bad_style` is being deprecated in favor of `nonstandard_style`: - rust-lang#41646
…shearth Replace usages of 'bad_style' with 'nonstandard_style'. `bad_style` is being deprecated in favor of `nonstandard_style`: - rust-lang#41646
…shearth Replace usages of 'bad_style' with 'nonstandard_style'. `bad_style` is being deprecated in favor of `nonstandard_style`: - rust-lang#41646
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please direct comments about moderation to the moderators or to new forum threads. |
Make `bad_style` a silent alias for `nonstandard_style` Now only `nonstandard_style` is suggested in `rustc -W help`, but `bad_style` will not produce a warning. Closes #41646. r? @Manishearth
`bad_style` is being deprecated in favor of `nonstandard_style`: - rust-lang/rust#41646
@ashleygwilliams mentioned this in her talk today;
#[allow(bad_style)]
is a rather rebuke-y shame-y annotation on code.While we do want people to use proper style, it's a useful tool whilst learning to be able to turn off all the extra friction that you deal with that you don't have to. Let's be nicer about it; could we rename this to
nonstandard_style
and keepbad_style
as a backcompat alias?Unsure if this requires an RFC.
The text was updated successfully, but these errors were encountered: