Skip to content

Commit 13b3909

Browse files
authored
Merge pull request #88 from alephcloud/version-0.7.1f
Version 0.7.1
2 parents 2bf1a00 + 0e3ce01 commit 13b3909

File tree

4 files changed

+41
-12
lines changed

4 files changed

+41
-12
lines changed

.github/workflows/cabal-ci.yaml

+11-2
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ jobs:
5757
5858
# Restore dist-newstyle
5959
- name: Cache dist-newstyle
60+
id: dist-cache-restore
6061
uses: actions/cache@v4
6162
with:
6263
path: |
6364
dist-newstyle
6465
key: dist-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.local') }}
6566
restore-keys: |
6667
dist-${{ matrix.os }}-${{ matrix.ghc }}-
67-
save-always: true
6868
6969
# Build
7070
- name: Update package database
@@ -85,7 +85,7 @@ jobs:
8585
# Save packages
8686
- name: Save cache for ~/.cabal/packages and ~/.cabal/store
8787
uses: actions/cache/save@v4
88-
if: always()
88+
if: always() && steps.deps-cache-restore.outputs.cache-hit != 'true'
8989
with:
9090
path: |
9191
~/.cabal/packages
@@ -99,3 +99,12 @@ jobs:
9999
- name: Run Tests
100100
run: cabal test
101101

102+
# Safe dist
103+
- name: Save cache dist-newstyle
104+
uses: actions/cache/save@v4
105+
if: always() && steps.dist-cache-restore.outputs.cache-hit != 'true'
106+
with:
107+
path: |
108+
dist-newstyle
109+
key: ${{ steps.dist-cache-restore.outputs.cache-primary-key }}
110+

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# configuration-tools
22

3+
## 0.7.1 (2025-03-04)
4+
5+
* Support lastest GHC (9.12)
6+
* Use setters instead of lenses in ..: and %.:
7+
* Allow validation functions to return new values
8+
39
## 0.7.0 (2022-06-22)
410

511
The version bump is due to the update of the dependency on optparse-applicative,

configuration-tools.cabal

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: configuration-tools
4-
version: 0.7.0
4+
version: 0.7.1
55
synopsis: Tools for specifying and parsing configurations
66
description:
77
Tools for specifying and parsing configurations
@@ -30,19 +30,20 @@ bug-reports: https://github.com/alephcloud/hs-configuration-tools/issues
3030
license: MIT
3131
license-file: LICENSE
3232
author: Lars Kuhtz <[email protected]>
33-
maintainer: Lars Kuhtz <[email protected]>
33+
maintainer: Lars Kuhtz <[email protected]>, Edmund Noble <[email protected]>
3434
copyright:
35+
(c) 2024-2025 Edmund Noble <[email protected]>,
3536
(c) 2019-2020 Colin Woodbury <[email protected]>,
36-
(c) 2015-2023 Lars Kuhtz <[email protected]>,
37+
(c) 2015-2025 Lars Kuhtz <[email protected]>,
3738
(c) 2014-2015 AlephCloud, Inc.
3839
category: Configuration, Console
3940
build-type: Custom
4041
tested-with:
42+
, GHC==9.12
43+
, GHC==9.10
44+
, GHC==9.8
4145
, GHC==9.6
4246
, GHC==9.4
43-
, GHC==9.2
44-
, GHC==9.0.1
45-
, GHC==8.10.7
4647

4748
extra-doc-files:
4849
README.md,

src/Configuration/Utils.hs

+17-4
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,19 @@ programInfo
280280
-- ^ default configuration
281281
ProgramInfo a
282282
programInfo desc parser defaultConfig =
283-
programInfoValidate desc parser defaultConfig $ return
283+
programInfoValidate desc parser defaultConfig $ const (return ())
284284

285285
-- | Smart constructor for 'ProgramInfo'.
286286
--
287287
-- 'piHelpHeader' and 'piHelpFooter' are set to 'Nothing'.
288288
--
289-
programInfoValidate
289+
programInfoValidate'
290290
String
291291
MParser a
292292
a
293293
ConfigValidation' a f r
294294
ProgramInfoValidate' a f r
295-
programInfoValidate desc parser defaultConfig valFunc = ProgramInfo
295+
programInfoValidate' desc parser defaultConfig valFunc = ProgramInfo
296296
{ _piDescription = desc
297297
, _piHelpHeader = Nothing
298298
, _piHelpFooter = Nothing
@@ -302,6 +302,19 @@ programInfoValidate desc parser defaultConfig valFunc = ProgramInfo
302302
, _piConfigurationFiles = []
303303
}
304304

305+
-- | Smart constructor for 'ProgramInfo'.
306+
--
307+
-- 'piHelpHeader' and 'piHelpFooter' are set to 'Nothing'.
308+
--
309+
programInfoValidate
310+
String
311+
MParser a
312+
a
313+
ConfigValidation a f
314+
ProgramInfoValidate a f
315+
programInfoValidate desc parser defaultConfig valFunc =
316+
programInfoValidate' desc parser defaultConfig $ \c -> valFunc c >> return c
317+
305318
-- -------------------------------------------------------------------------- --
306319
-- AppConfiguration
307320

@@ -718,7 +731,7 @@ parseConfiguration
718731
)
719732
T.Text
720733
-- ^ program name (used in error messages)
721-
ProgramInfoValidate a f
734+
ProgramInfoValidate' a f r
722735
-- ^ program info value; use 'programInfo' to construct a value of this
723736
-- type
724737
[String]

0 commit comments

Comments
 (0)