-
Notifications
You must be signed in to change notification settings - Fork 925
Audit config options #1974
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
Comments
A list of config options, in a bit of organized fashion (ran out of gas). Catch-all
BraceI think we can combine these into a single
Comment
IndentI think we should make these names consistent (
Match arm
SpaceIt feels to me that these are too narrow to support except
String
Vertical alignement
WidthAgain, we should name these consistently (
Horizontal v.s. Vertical v.s. Mixed
Sort items
What to do with empty block bodyWe can combine these into
Allow single line
LegacyThese options do not take effect or work well with the RFC style. I think it is safe to deprecate these options.
Not exposed to users
Others
|
We should also think about which options should be stable (vs unstable). I think we can start conservatively and only make That leaves the non-formatting options such as |
So, a big question for me is what style of options we want to permit. Currently we have very fine-grained options, which makes Rustfmt very customisable, but:
An alternative would be to support a small set of coarse grained styles. E.g., a compressed style would enable all the 'one line' options plus set wider values for the width heuristics, etc. We might support a style which always puts opening braces on a newline, but not any way to mix that with the 'braces on the same line' style. We would aim to support each of these larger styles on their own, but combining them is at the user's own risk (and we would explicitly not test combinations). If we don't do this, I think we probably need to combine options into groups in the documentation or something in order to make them less confusing. Thoughts? |
Some replies to @topecongiro's big list (thanks for doing that!):
|
|
Hmm, I'm not sure (and now I'm rethinking what to do about the legacy category). We might have a single overriding OTOH, given the overwhelming support for the new style, I wonder if there is any need to provide a 'visual' style at all? Perhaps we do it as a first step and maybe remove later. |
Sounds good to me. |
In a series of commits up to 86007e7, I have made a dent in reviewing the options. I think that I have removed all the low-hanging fruit and stabilised the options I want stable for 1.0. I've tried to organise the options a bit more in config.rs, once we're done we should extend that organisation to documentation. Outstanding areas for concern:
|
With the latest bunch of commits, I've addressed everything I think needs to be addressed for 1.0, except #2185 (I'm leaving this issue on the milestone until that is fixed). I think we should still address the questions in the above comment, but they only apply to unstable options and I believe we can make changes post-1.0. |
@nrc Thank you very much! |
Concerning the let result = some_variable.foo()
.do_with(|thing| thing.bar())
.filter(|a| a < bzz)
.unwrap_or(44)
.collect(); Vs: let result = some_variable.foo()
.do_with(|thing| thing.bar())
.filter(|a| a < bzz)
.unwrap_or(44)
.collect(); I understand the need to remove options to keep the codebase sane, but is there any chance that this kind of setting might come back at some point, once 1.0 is released for example? |
It is unlikely - visual indenting of chains has not been very popular. If there is a lot of demand, then it is possible, but that does seem unlikely to me. |
The changes made here are great! ❤️ However, it was difficult to figure out how to update my personal and project After realizing what happened, again it wasn't easy to update the config, because the old names are note listed in <Configurations.md>. Would be great to either add the old names to <Configurations.md> and refer everyone there, or add a hint in the runtime warnings about the new name for each deprecated setting. |
I think it would be good to do both! |
Outstanding questions before I think we can take this off the milestone:
|
On reflection, I think |
I'm stabilising |
I actually think we could remove this option |
Still outstanding:
There are a bunch of unstable options I'd like to remove, but that can wait till post-1.0 |
I've made |
Are there options which we should not bother to support? Options which could be combined? Of those we should keep, which are certain enough of (both that they should exist and of their behaviour) that we should consider them stable?
The text was updated successfully, but these errors were encountered: