-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Default values of width settings #2288
Comments
@dsyme any thoughts on this given your experiences on formatting the compiler? |
We're using this in the F# Compiler, though that's not necessarily representative
Of these I guess I'd argue for the following
I haven't yet played with ``fsharp_max_if_then_short_width`, I assume we'll want 0 like the default. |
Thank you for your input, much appreciated. I think the rationale is on point here.
I think maybe 60 will be less impactful there. Doubling the existing size might shake things up too much.
Interestingly enough, this setting was implemented to adhere to the G-Research style guide.
I'll try these settings out on some code bases to see what this gives. |
This is one of the best examples where keeping the existing "single-line vs multi-line" style plus checking overall line length would likely work better in the most cases than checking an Tweaking the settings like this can mostly work for a single code base, but the formatter should work well on many projects, and tweaking settings like this will likely lead to aggressively rewriting of some perfectly-formatted code in some projects anyway. In addition to that, if we want to enable incremental formatting during typing in future, we definitely don't want to rewrite code that aggressively, otherwise it wouldn't be a good user experience, so the formatter has to keep properly formatted code untouched. It doesn't seem difficult to check if an if a then b else c if a then
b
else
c if a then b else
c |
@nojaf asked for some more info This is too much penalty for defining data: I think this is only relevant to But in any case the point I'm making is that data definitions can easily get penalized from 1 line to 10s of lines under default settings. |
Hey @auduchinok, could you open a new issue for your points. |
As we are developing the next major version of Fantomas, it might be a good time to revisit the default values.
I believe there are three categories of settings:
The first group is the one I'd like to revisit.
The second group should be disabled by default.
And the third group is probably fine as is.
On a side note, the maximum width settings are not mentioned in the style guide and I don't think this is a bad thing. Different projects will have different needs and some level of flexibility feels ok here.
Anyway, the default value of the following settings might need an update:
Please o please provide your reasoning for increasing or decreasing certain settings.
I personally find it terribly hard to change these default values because a few people say
x
ory
"feels" better.Changing these defaults will impact everyone using Fantomas, so "With great power, comes great responsibility"
The text was updated successfully, but these errors were encountered: