-
Notifications
You must be signed in to change notification settings - Fork 83
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
Indent post-guard expression one level more #806
Comments
Changes like that are really frustrating and undermine "opinionated formatter" positioning, to be honest. Either opinions should never change, really, or options should be added, otherwise you make what started as a useful tool into a very annoying tool creating a lot of unnecessary noise in the source code whenever you change the version... See #1061 |
I'm curious what you find frustrating about it. Is it simply that it's a change in behavior (and an opinionated formatter should never change), or is it that you actually prefer it unindented? To put it in a different way, if the change were reversed (i.e. ormolu initially indented post-guard expressions and a change was made to unindent them), would you be similarly frustrated? |
Thanks for asking. Absolutely, I would be as frustrated :) Ormolu didn’t offer the style I used before using ormolu, it was VERY different - I used leading commas, leading arrows in multiline types, etc. But the appeal of having no arguments about style with other people was much stronger than any particular style, so I accepted the fact that it’s just different and got used to it. So seeing it change as arbitrarily when moving to the latest version (and not that I want to move to it, but we have to, to support 9.6.2 parser) is frustrating, whatever the change is, irrespective of whether it makes formatting better or worse - it creates noise in the diff and conflicts with other branches, and also creates a cognitive overload to adjust the “parser” in the brain to the new style, reducing the speed of reading code until this adjustment happens. The main value of ormolu for me was “here is the style, use it, no need to argue about it”, and it was great because I’ve seen every team spending A LOT of time arguing. The value of consistent and unchanging style is in saving time, as you don’t have to re-wire your brain, and not in aesthetics or readability of particular style - anything is readable once you get used to it. But anyway, no combination of options in fourmolu allows to keep the original ormolu style (that is, no parents for single type classes and no indentation for guards, so I’ll just have to live with the new style now, fix the conflicts and get used to it :) I’ll just hope that if you decide to change it again there at least will be option to avoid this change… The need to add this option would make this change less likely to happen, so the value of this change would need to be higher for it to happen, which is also good for everybody. |
Is your feature request related to a problem? Please describe.
Currently, expressions are indented just one more indentation level after a guard, which makes me confuse the guard from the expression. e.g.
When I look at this, my eyes glaze over the
|
and just see 6 lines at the same indentation level.Describe the solution you'd like
I think it's less confusing for it to be indented one more, e.g.
To me, this is much clearer, as it clearly separates the guard from the expression. I can clearly see two guards, with two lines of expression each, whereas before, I saw 6 lines of guards/expressions?
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: