Skip to content

Commit a79604e

Browse files
committed
Format .cabal files with cabal-gild
1 parent 7a334ac commit a79604e

File tree

4 files changed

+44
-37
lines changed

4 files changed

+44
-37
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
with:
3939
extra_nix_config: |
4040
accept-flake-config = true
41-
- name: Format via Cabal and Ormolu
41+
- name: Format via Ormolu
4242
run: |
4343
nix run .#format
4444
git diff --exit-code --color=always

flake.lock

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

flake.nix

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
99
flake-utils.url = "github:numtide/flake-utils";
1010
pre-commit-hooks = {
11-
url = "github:cachix/pre-commit-hooks.nix";
12-
inputs.nixpkgs.follows = "nixpkgs";
13-
inputs.flake-utils.follows = "flake-utils";
11+
url = "github:amesgen/pre-commit-hooks.nix/cabal-gild";
1412
};
1513

1614
# for Ormolu Live
@@ -119,6 +117,7 @@
119117
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
120118
src = ./.;
121119
hooks = {
120+
cabal-gild.enable = true;
122121
nixpkgs-fmt.enable = true;
123122
deadnix.enable = true;
124123
purs-tidy.enable = true;
@@ -150,7 +149,6 @@
150149
name = "ormolu-format";
151150
text = builtins.readFile ./nix/format.sh;
152151
runtimeInputs = [
153-
(defaultGHC.dev.hsPkgs.tool "cabal" "latest")
154152
defaultGHC.ormolu
155153
];
156154
};
@@ -165,6 +163,7 @@
165163
configureArgs = "--disable-benchmarks --disable-tests";
166164
};
167165
};
166+
nativeBuildInputs = pre-commit-check.enabledPackages;
168167
withHoogle = false;
169168
exactDeps = false;
170169
inherit (pre-commit-check) shellHook;

nix/format.sh

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
export LANG="C.UTF-8"
44

5-
cabal format
6-
(cd extract-hackage-info && cabal format)
7-
(cd ormolu-live && cabal format)
8-
95
export dirs="src app tests extract-hackage-info/src ormolu-live/app"
106
# shellcheck disable=SC2046,SC2086
117
ormolu -m inplace $(find $dirs -type f -name "*.hs" -o -name "*.hs-boot")

0 commit comments

Comments
 (0)