on master help sign in
Merge pull request #216 from andreasabel/optparse-applicative-0.18
5da321dMichael Snoyman
.github/workflows/tests.yml+10−6
@@ -14,24 +14,28 @@ jobs:
14 fail-fast: false
14 fail-fast: false
15 matrix:
15 matrix:
16 os: [ubuntu-latest, macos-latest, windows-latest]
16 os: [ubuntu-latest, macos-latest, windows-latest]
17− resolver: [nightly, lts-20, lts-15, lts-14, lts-12, lts-11, lts-9]
17+ resolver: [nightly, lts-20, lts-15, lts-14, lts-12, lts-11]
18− # Bugs in GHC make it crash too often to be worth running
19 exclude:
18 exclude:
20− - os: macos-latest
21− resolver: lts-9
22 - os: windows-latest
19 - os: windows-latest
23 resolver: lts-15
20 resolver: lts-15
24 - os: windows-latest
21 - os: windows-latest
25 resolver: nightly
22 resolver: nightly
23+ include:
24+ - os: ubuntu-latest
25+ resolver: lts-9
26+ # problems on macOS and Windows (https://github.com/snoyberg/yaml/pull/216#issuecomment-1585522312)
26
27
27 steps:
28 steps:
28 - name: Clone project
29 - name: Clone project
29− uses: actions/checkout@v2
30+ uses: actions/checkout@v3
30
31
31 - name: Cache dependencies
32 - name: Cache dependencies
33+ if: ${{ runner.os != 'Windows' }}
34+ # Andreas Abel, 2023-06-10, switching off caching on Windows since ~/.stack is not the correct path here.
32− uses: actions/cache@v1
35+ uses: actions/cache@v3
33 with:
36 with:
34 path: ~/.stack
37 path: ~/.stack
38+ #NB: This path is not valid on Windows
35 key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}
39 key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}
36 restore-keys: |
40 restore-keys: |
37 ${{ runner.os }}-${{ matrix.resolver }}-
41 ${{ runner.os }}-${{ matrix.resolver }}-
stack.yaml+1−1
@@ -1,4 +1,4 @@
1−resolver: lts-20.5
1+resolver: lts-20.25
2
2
3flags:
3flags:
4 yaml:
4 yaml:
yaml/exe/json2yaml.hs+3−3
@@ -15,7 +15,7 @@ import Options.Applicative
15 , long, metavar, short, strArgument, strOption, value
15 , long, metavar, short, strArgument, strOption, value
16 )
16 )
17import Options.Applicative.Help.Pretty
17import Options.Applicative.Help.Pretty
18− ( vcat, text )
18+ ( vcat, pretty )
19
19
20import System.Exit ( die )
20import System.Exit ( die )
21
21
@@ -43,11 +43,11 @@ options =
43 <> footerDoc fdoc
43 <> footerDoc fdoc
44
44
45 where
45 where
46− hdoc = Just $ vcat $ map text
46+ hdoc = Just $ vcat $ map pretty
47 [ versionText self
47 [ versionText self
48 , "Convert JSON to YAML."
48 , "Convert JSON to YAML."
49 ]
49 ]
50− fdoc = Just $ text $ concat
50+ fdoc = Just $ pretty $ concat
51 [ "The old call pattern '"
51 [ "The old call pattern '"
52 , self
52 , self
53 , " IN OUT' is also accepted, but deprecated."
53 , " IN OUT' is also accepted, but deprecated."
yaml/exe/yaml2json.hs+2−2
@@ -17,7 +17,7 @@ import Options.Applicative
17 , long, metavar, short, strArgument, strOption, value
17 , long, metavar, short, strArgument, strOption, value
18 )
18 )
19import Options.Applicative.Help.Pretty
19import Options.Applicative.Help.Pretty
20− ( vcat, text )
20+ ( vcat, pretty )
21
21
22import Common
22import Common
23 ( versionText, versionOption, numericVersionOption, dashToNothing )
23 ( versionText, versionOption, numericVersionOption, dashToNothing )
@@ -43,7 +43,7 @@ options =
43 (headerDoc hdoc)
43 (headerDoc hdoc)
44
44
45 where
45 where
46− hdoc = Just $ vcat $ map text
46+ hdoc = Just $ vcat $ map pretty
47 [ versionText self
47 [ versionText self
48 , "Convert YAML to JSON."
48 , "Convert YAML to JSON."
49 ]
49 ]