Always insert newline after 'do'#5
Closed
georgefst wants to merge 1 commit intofourmolu:masterfrom
georgefst:master
Closed
Always insert newline after 'do'#5georgefst wants to merge 1 commit intofourmolu:masterfrom georgefst:master
georgefst wants to merge 1 commit intofourmolu:masterfrom
georgefst:master
Conversation
This fixes a bug where formatting could change the AST, due to four space indentation taking an infix operator past the end column of 'do'.
Collaborator
Author
Well, only if we disable the idempotence tests, obviously. |
Collaborator
|
What's the idempotency tests that are failing? I'm in favor of this. I have occasionally used a form with blockarguments like map
do \x -> ...
do filter p xsbut I would not be upset if a newline happened. |
Collaborator
Author
|
Actually, they mostly come down to the fact that The one other case then is the $( do [d| baz = baz |] )formatted to: $(do
[d|baz = baz|])then: $( do
[d|baz = baz|]
) |
Collaborator
Author
|
Closing in favour of #6. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ugh, this is potentially a one-line fix, except that a handful of tests now fail with idempotence issues...
I guess we've gotta ask how much we care about holding ourselves to the same standards as the main
ormolubranch in that respect. The upshot of not caring here would be that users may sometimes have to format twice if they write some really odd code using unusually compactdo-notation.Idempotence is obviously a valuable property, but if we start allowing some configuration, it's going to be increasingly difficult to guarantee in all cases anyway.
Fixes #1 (for good this time)