Skip to content

Commit defd114

Browse files
committed
Remove stylish haskell. Use only fourmolu.
1 parent 5858356 commit defd114

File tree

6 files changed

+46
-133
lines changed

6 files changed

+46
-133
lines changed

.github/workflows/check-formatting.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ jobs:
4141
4242
for x in $(git ls-tree --full-tree --name-only -r HEAD); do
4343
if [ "${x##*.}" == "hs" ]; then
44-
if grep -qE '^#' "$x"; then
45-
echo "$x contains CPP. Skipping."
46-
else
47-
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
48-
fi
44+
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
4945
fi
5046
done
5147
@@ -58,11 +54,7 @@ jobs:
5854
git fetch origin ${{ github.base_ref }} --unshallow
5955
for x in $(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}..HEAD); do
6056
if [ "${x##*.}" == "hs" ]; then
61-
if grep -qE '^#' "$x"; then
62-
echo "$x contains CPP. Skipping."
63-
else
64-
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
65-
fi
57+
"$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x"
6658
fi
6759
done
6860

.stylish-haskell.yaml

Lines changed: 0 additions & 114 deletions
This file was deleted.

cardano-api/cardano-api.cabal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ extra-doc-files:
2222

2323
common project-config
2424
default-language: Haskell2010
25-
default-extensions: OverloadedStrings
25+
default-extensions:
26+
ImportQualifiedPost
27+
OverloadedStrings
28+
2629
build-depends: base >=4.14 && <4.21
2730
ghc-options:
2831
-Wall

flake.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
fourmolu = "0.18.0.0";
102102
haskell-language-server.src = nixpkgs.haskell-nix.sources."hls-2.9";
103103
hlint = "3.8";
104-
stylish-haskell = "0.14.6.0";
105104
};
106105
# and from nixpkgs or other inputs
107106
shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck];

fourmolu.yaml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,44 @@ column-limit: 100
33
function-arrows: leading
44
comma-style: leading
55
import-export-style: leading
6-
# we need https://github.com/IntersectMBO/cardano-api/pull/744/ to ditch stylish
7-
import-grouping: legacy
8-
indent-wheres: false
9-
record-brace-space: false
6+
import-grouping:
7+
- rules:
8+
- glob: Cardano.Api**
9+
- rules:
10+
- glob: Cardano**
11+
- glob: Ouroboros**
12+
- glob: PlutusCore**
13+
- glob: PlutusLedgerApi**
14+
- rules:
15+
- glob: Prelude**
16+
- glob: RIO**
17+
- rules:
18+
- glob: Control**
19+
- glob: Codec**
20+
- glob: Data**
21+
- glob: Formatting**
22+
- glob: GHC**
23+
- glob: Lens**
24+
- glob: Network**
25+
- glob: Numeric**
26+
- glob: Options**
27+
- glob: Prettyprinter**
28+
- glob: System**
29+
- glob: Text**
30+
- rules:
31+
- glob: Test.Gen.Cardano.Api**
32+
- rules:
33+
- glob: Test.Cardano**
34+
- glob: Test.Gen.Cardano**
35+
- rules:
36+
- glob: Hedgehog**
37+
- glob: Test**
38+
- name: "The rest"
39+
rules:
40+
- match: all
41+
priority: 100
42+
indent-wheres: false
43+
record-brace-space: false
1044
newlines-between-decls: 1
1145
haddock-style: single-line
1246
haddock-style-module:

scripts/devshell/prettify

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Function to display help message
44
show_help() {
55
echo "Usage: $(basename $0) <OPTION|FILES>"
6-
echo "Format Haskell source files using fourmolu and stylish-haskell."
6+
echo "Format Haskell source files using fourmolu."
77
echo ""
88
echo "Options:"
99
echo " -t, --tracked Format all tracked Haskell (*.hs) files in the repository"
@@ -39,7 +39,6 @@ run_format() {
3939
echo -e "${green_colour}Formatting: ${blue_colour}${relative_path}${reset_colour}"
4040
fourmolu -q -i "$top_level/$relative_path"
4141
fourmolu -q -i "$top_level/$relative_path"
42-
stylish-haskell -i "$top_level/$relative_path"
4342
fi
4443
fi
4544
done
@@ -91,7 +90,7 @@ for file in $files; do
9190
fi
9291
done
9392

94-
for tool in stylish-haskell fourmolu
93+
for tool in fourmolu
9594
do
9695
if ! (which $tool > /dev/null 2>&1); then
9796
echo "ERROR: $tool is not available!"

0 commit comments

Comments
 (0)