Skip to content

Commit 847aad9

Browse files
jbertholdgithub-actions
and
github-actions
authoredApr 4, 2024··
Booster-532: align fourmolu and hlint versions (#3756)
Preparing runtimeverification/hs-backend-booster#532 * Use `fourmolu 0.14.0.0`, reformatting the code as required (large change) * use `hlint-3.6.1` to check code style (adjusting code and config as required) * provide `hlint-3.6.1` in nix derivation `#fourmolu` --------- Co-authored-by: github-actions <[email protected]>
1 parent 531f7c1 commit 847aad9

File tree

9 files changed

+38
-43
lines changed

9 files changed

+38
-43
lines changed
 

‎.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
115115
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
116116
117-
- uses: haskell-actions/setup@v2
117+
- uses: haskell-actions/setup@v2.7
118118
id: setup-haskell-stack
119119
with:
120120
ghc-version: ${{ env.ghc_version }}
@@ -148,7 +148,7 @@ jobs:
148148
stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
149149
stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
150150
151-
- uses: haskell-actions/setup@v2.6.1
151+
- uses: haskell-actions/setup@v2.7
152152
id: setup-haskell-stack
153153
with:
154154
ghc-version: ${{ env.ghc_version }}

‎.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
submodules: recursive
140140

141141
- name: Install Nix
142-
uses: cachix/install-nix-action@v25
142+
uses: cachix/install-nix-action@v26
143143
with:
144144
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
145145
extra_nix_config: |
@@ -183,7 +183,7 @@ jobs:
183183
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
184184
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
185185
186-
- uses: haskell-actions/setup@v2.6.1
186+
- uses: haskell-actions/setup@v2.7
187187
id: setup-haskell-stack
188188
with:
189189
ghc-version: ${{ env.ghc_version }}
@@ -207,7 +207,7 @@ jobs:
207207
needs: formatting
208208
runs-on: ubuntu-22.04
209209
env:
210-
hlint_version: "3.5"
210+
hlint_version: "3.6.1"
211211
steps:
212212
- uses: actions/checkout@v4
213213
with:

‎.hlint.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
- ignore: {name: "Replace case with maybe"}
3939
- ignore: {name: "Hoist not"}
4040
- ignore: {name: "Redundant bracket"}
41+
- ignore: {name: "Fuse foldr/fmap"}
4142

4243
# Ignore suggestions to reduce duplication, because:
4344
# - High rate of false positives
@@ -50,8 +51,8 @@
5051
- ignore: {name: Redundant lambda}
5152

5253
# Testing class laws
53-
- ignore: {name: Functor law, within: [Test.Data.Sup, Test.ListT]}
54-
- ignore: {name: Use /=, within: [Test.Data.Sup]}
54+
- ignore: {name: "Functor law", within: [Test.Data.Sup, Test.ListT]}
55+
- ignore: {name: "Use /=", within: [Test.Data.Sup]}
5556
- ignore: {name: "Alternative law, left identity", within: [Test.ListT]}
5657
- ignore: {name: "Alternative law, right identity", within: [Test.ListT]}
5758
- ignore: {name: "Monad law, right identity", within: [Test.ListT]}

‎flake.lock

-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
inputs = {
44
rv-utils.url = "github:runtimeverification/rv-nix-tools";
55
nixpkgs.follows = "rv-utils/nixpkgs";
6-
nixpkgs2305.url = "nixpkgs/nixos-23.05";
76
stacklock2nix.url = "github:cdepillabout/stacklock2nix";
87
z3 = {
98
url = "github:Z3Prover/z3/z3-4.12.1";
109
flake = false;
1110
};
1211
};
13-
outputs = { self, nixpkgs, nixpkgs2305, stacklock2nix, z3, rv-utils }:
12+
outputs = { self, nixpkgs, stacklock2nix, z3, rv-utils }:
1413
let
1514
perSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
1615
nixpkgsCleanFor = system: import nixpkgs { inherit system; };
@@ -201,8 +200,7 @@
201200
additionalDevShellNativeBuildInputs = stacklockHaskellPkgSet:
202201
with ghcVersion final; [
203202
cabal-install
204-
# fourmolu
205-
(import nixpkgs2305 { inherit (prev) system; }).haskellPackages.fourmolu_0_12_0_0
203+
fourmolu
206204
hlint
207205
stacklockHaskellPkgSet.haskell-language-server
208206
final.haskell-language-server
@@ -239,9 +237,9 @@
239237
mkShell {
240238
nativeBuildInputs = [
241239
(haskell.lib.justStaticExecutables
242-
# (ghcVersion pkgs).fourmolu
243-
(import nixpkgs2305 { inherit system; }).haskellPackages.fourmolu_0_12_0_0
244-
)
240+
(ghcVersion pkgs).fourmolu)
241+
(haskell.lib.justStaticExecutables
242+
(ghcVersion pkgs).hlint)
245243
];
246244
};
247245
cabal = let pkgs = nixpkgsFor system;

‎fourmolu.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,18 @@ column-limit: 100
1212

1313
# whether to put parentheses around single constraints (`auto` would keep existing ones)
1414
single-constraint-parens: never
15+
16+
reexports:
17+
- module Prelude.Kore exports Prelude
18+
- module Prelude.Kore exports Data.Foldable
19+
- module Prelude.Kore exports Data.Traversable
20+
- module Prelude.Kore exports Control.Comonad
21+
- module Kore.Pretty exports Prettyprinter
22+
23+
fixities:
24+
- infixr 7 <>
25+
- infixr 6 <+>
26+
- infixl 4 <$>, <*>, <*, *>, <**>
27+
- infixl 3 <|>
28+
- infixl 1 &, >>=, >>, <&>
29+
- infixr 0 $

‎kore/src/Kore/Exec.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,8 @@ matchDisjunction ::
900900
matchDisjunction mainModule matchPattern disjunctionPattern =
901901
evalSimplifierProofs mainModule $ do
902902
results <-
903-
traverse (runMaybeT . match matchPattern) disjunctionPattern
904-
<&> catMaybes
905-
<&> concatMap toList
903+
concatMap toList . catMaybes
904+
<$> traverse (runMaybeT . match matchPattern) disjunctionPattern
906905
results
907906
<&> Condition.toPredicate
908907
& Predicate.makeMultipleOrPredicate

‎kore/src/Kore/Exec/GraphTraversal.hs

+7-7
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,13 @@ graphTraversal
376376
filter isStop collected
377377
pure $
378378
if
379-
| (not $ null stuck) ->
380-
GotStuck 0 (mapMaybe extractStuckOrVacuous stuck)
381-
| not $ null unproven ->
382-
Stopped
383-
(mapMaybe extractState unproven)
384-
(concatMap extractNext unproven)
385-
| otherwise -> fmap currentState result
379+
| (not $ null stuck) ->
380+
GotStuck 0 (mapMaybe extractStuckOrVacuous stuck)
381+
| not $ null unproven ->
382+
Stopped
383+
(mapMaybe extractState unproven)
384+
(concatMap extractNext unproven)
385+
| otherwise -> fmap currentState result
386386
other -> pure $ fmap currentState other
387387

388388
{- | Used to select whether the step should be canceled

‎kore/test/Test/Kore/Syntax/Json/Roundtrips.hs

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ patternsFrom path = do
3535

3636
getPatterns :: ParsedDefinition -> [ParsedPattern]
3737
getPatterns =
38-
mapMaybe fromSentence
39-
. concatMap Kore.moduleSentences
40-
. Kore.definitionModules
38+
concatMap (mapMaybe fromSentence . Kore.moduleSentences) . Kore.definitionModules
4139

4240
fromSentence :: Kore.Sentence ParsedPattern -> Maybe ParsedPattern
4341
fromSentence (Kore.SentenceAliasSentence alias) =

0 commit comments

Comments
 (0)
Please sign in to comment.