Skip to content

Always parenthesize custom headers #2280

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

Merged
merged 2 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dhall/src/Dhall/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ instance Pretty URL where
<> foldMap prettyHeaders headers
where
prettyHeaders h =
" using " <> Pretty.unAnnotate (prettyImportExpression h)
" using (" <> Pretty.unAnnotate (Pretty.pretty h) <> ")"

File {..} = path

Expand Down
6 changes: 6 additions & 0 deletions dhall/tests/format/parenthesizeUsingA.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- https://github.com/dhall-lang/dhall-haskell/issues/2273
let MyPackage =
https://server.test/package.dhall using (./headers.dhall)
sha256:03a6e298ff140d430cea8b387fad886ce9f5bee24622c7d1102115cc08ed9cf8

in MyPackage
6 changes: 6 additions & 0 deletions dhall/tests/format/parenthesizeUsingB.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- https://github.com/dhall-lang/dhall-haskell/issues/2273
let MyPackage =
https://server.test/package.dhall using (./headers.dhall)
sha256:03a6e298ff140d430cea8b387fad886ce9f5bee24622c7d1102115cc08ed9cf8

in MyPackage