-
Notifications
You must be signed in to change notification settings - Fork 219
Format more text literals as multi-line strings #1508
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
Conversation
Two tests currently trigger a dhall-haskell/dhall/src/Dhall/Pretty/Internal.hs Lines 1113 to 1117 in cc1814b
We also use dhall-haskell/dhall/tests/Dhall/Test/Diff.hs Lines 53 to 59 in cc1814b
|
@sjakobi: As discussed in the other issue, another way you can fix this is to ensure that every use of |
It seems to me that we couldn't then enforce the multi-line formatting of the text literals that this PR is about. If it is important that These are the problematic tests: 1dhall-haskell/dhall/tests/Dhall/Test/Regression.hs Lines 90 to 93 in cc1814b
Here we use dhall-haskell/dhall/tests/Dhall/Test/Util.hs Lines 63 to 64 in cc1814b
2dhall-haskell/dhall/tests/Dhall/Test/Tutorial.hs Lines 49 to 57 in cc1814b
We again use I think my preference would be to simply use the 80-column layout consistently, so we don't have to worry about different layout variants. |
@sjakobi: I agree that the best solution here is to consistently avoid the |
This causes text literals to be formatted as multi-line strings whenever they contain at least one newline and at least one non-newline character. "Spacers" like `"\n\n"` continue be formatted as single-line strings. If the heuristic turns out to be too eager to choose a multi-line layout, we can refine it later. This partially addresses #1496. Also * update some variable names * use 80-column "smart" layout consistently
3485109
to
2f48830
Compare
This changes the formatting of Dhall source files affected by dhall-lang/dhall-haskell#183 or dhall-lang/dhall-haskell#1400. The change in Prelude/Text/show is due to dhall-lang/dhall-haskell#1508.
This changes the formatting of Dhall source files affected by dhall-lang/dhall-haskell#183 or dhall-lang/dhall-haskell#1400. The change in Prelude/Text/show is due to dhall-lang/dhall-haskell#1508, but also relies the bug fixes dhall-lang/dhall-haskell/pull/1543 and dhall-lang/dhall-haskell/pull/1550.
This changes the formatting of Dhall source files affected by dhall-lang/dhall-haskell#183 or dhall-lang/dhall-haskell#1400. The change in Prelude/Text/show is due to dhall-lang/dhall-haskell#1508, but also relies the bug fixes dhall-lang/dhall-haskell/pull/1543 and dhall-lang/dhall-haskell/pull/1550.
This causes text literals to be formatted as multi-line strings whenever they contain at least one newline and at least one non-newline character. "Spacers" like
"\n\n"
continue be formatted as single-line strings. If the heuristic turns out to be too eager to choose a multi-line layout, we can refine it later.This partially addresses #1496.