-
Notifications
You must be signed in to change notification settings - Fork 925
Confusing spread of width configurations #1984
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
cc #1974 I think whatever happens, we keep One approach for the others might be to have a single option - |
Yes I could deal with that. Although that name doesn't jump out at me as meaning what you describe. I do like a readable property name that I don't need to lookup. max_width = 101
all_widths_use_max_width = true # proposed We already have fine grain control with all the other rules. I would also suggest making sure the other rules end in |
To clarify, I was proposing removing the existing options (other than HOw about |
Ah right, you want to reduce the options in general. Well what you suggest would satisfy my use case (unified width wrapping). However, I would imagine that if one actually wanted separate widths for comments/if-else/structs etc (as you're proposing to keep default), they may also want to configure them. A simple approach to reducing config would be just unify all widths and improve Another idea, assuming the separate widths need to stay, would be to use factors of the |
Hello, with these change |
If you must have that level of configuration, you can build rustfmt yourself and change the values in |
In my settings, there were basically 3 groups.
struct_lit_width = 70 |
It is great that rustfmt is configurable, however I found the amount of width configurations & defaults initially confusing. I expected the fmt rules to work on a single max width, so all wrapping logic would work against that.
I actually avoided using rustfmt for a while, as I mistakenly thought it couldn't handle one-line struct patterns etc. Now I realise it can, but has a separate width to keep to. Silly me. But perhaps this can be simpler?
After grepping through the docs I now have, for my personal projects
Which seems to work for now, so thank you. However, this also seems a little fragile & ugly. I'd really prefer to declare it once, perhaps having all rules match
max_width
unless explicitly configured otherwise.Or some new rule:
The text was updated successfully, but these errors were encountered: