Skip to content

Commit

Permalink
Merge pull request #216 from andreasabel/optparse-applicative-0.18
Browse files Browse the repository at this point in the history
For `optparse-applicative-0.18`: use `pretty` instead of `text`
  • Loading branch information
snoyberg committed Jun 14, 2023
2 parents fe1c64a + 10a6955 commit 5da321d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,28 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
resolver: [nightly, lts-20, lts-15, lts-14, lts-12, lts-11, lts-9]
# Bugs in GHC make it crash too often to be worth running
resolver: [nightly, lts-20, lts-15, lts-14, lts-12, lts-11]
exclude:
- os: macos-latest
resolver: lts-9
- os: windows-latest
resolver: lts-15
- os: windows-latest
resolver: nightly
include:
- os: ubuntu-latest
resolver: lts-9
# problems on macOS and Windows (https://github.com/snoyberg/yaml/pull/216#issuecomment-1585522312)

steps:
- name: Clone project
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v1
if: ${{ runner.os != 'Windows' }}
# Andreas Abel, 2023-06-10, switching off caching on Windows since ~/.stack is not the correct path here.
uses: actions/cache@v3
with:
path: ~/.stack
#NB: This path is not valid on Windows
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-20.5
resolver: lts-20.25

flags:
yaml:
Expand Down
6 changes: 3 additions & 3 deletions yaml/exe/json2yaml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Options.Applicative
, long, metavar, short, strArgument, strOption, value
)
import Options.Applicative.Help.Pretty
( vcat, text )
( vcat, pretty )

import System.Exit ( die )

Expand Down Expand Up @@ -43,11 +43,11 @@ options =
<> footerDoc fdoc

where
hdoc = Just $ vcat $ map text
hdoc = Just $ vcat $ map pretty
[ versionText self
, "Convert JSON to YAML."
]
fdoc = Just $ text $ concat
fdoc = Just $ pretty $ concat
[ "The old call pattern '"
, self
, " IN OUT' is also accepted, but deprecated."
Expand Down
4 changes: 2 additions & 2 deletions yaml/exe/yaml2json.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Options.Applicative
, long, metavar, short, strArgument, strOption, value
)
import Options.Applicative.Help.Pretty
( vcat, text )
( vcat, pretty )

import Common
( versionText, versionOption, numericVersionOption, dashToNothing )
Expand All @@ -43,7 +43,7 @@ options =
(headerDoc hdoc)

where
hdoc = Just $ vcat $ map text
hdoc = Just $ vcat $ map pretty
[ versionText self
, "Convert YAML to JSON."
]
Expand Down

0 comments on commit 5da321d

Please sign in to comment.