Skip to content

Commit c60836d

Browse files
committed
Add treefmt, empty config for now
1 parent 3cb264c commit c60836d

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: hlint
2424
run: nix-build -A checks.hlint
2525

26+
- name: treefmt
27+
run: nix-build -A checks.treefmt
28+
2629
- name: build nixfmt
2730
run: nix-build
2831
if: success() || failure()

default.nix

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ let
3939
haskell.lib.dontHaddock
4040
(drv: lib.lazyDerivation { derivation = drv; })
4141
];
42+
43+
treefmtEval = (import sources.treefmt-nix).evalModule pkgs {
44+
# Used to find the project root
45+
projectRootFile = ".git/config";
46+
};
4247
in
4348
build
4449
// {
@@ -56,11 +61,17 @@ build
5661
shellcheck
5762
npins
5863
hlint
64+
treefmtEval.config.build.wrapper
5965
];
6066
};
6167

6268
checks = {
6369
hlint = pkgs.build.haskell.hlint src;
64-
stylish-haskell = pkgs.build.haskell.stylish-haskell ./.;
70+
treefmt = treefmtEval.config.build.check (
71+
lib.fileset.toSource {
72+
root = ./.;
73+
fileset = lib.fileset.gitTracked ./.;
74+
}
75+
);
6576
};
6677
}

npins/sources.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
"revision": "b6bbeda170469574789f9128c9aadc3a9e91e512",
1818
"url": "https://github.com/serokell/serokell.nix/archive/b6bbeda170469574789f9128c9aadc3a9e91e512.tar.gz",
1919
"hash": "1p6gsw00sbnpm01r6dg0m975xnr31xax1ciznl5rdpxarsrkibnn"
20+
},
21+
"treefmt-nix": {
22+
"type": "Git",
23+
"repository": {
24+
"type": "GitHub",
25+
"owner": "numtide",
26+
"repo": "treefmt-nix"
27+
},
28+
"branch": "main",
29+
"revision": "49dc4a92b02b8e68798abd99184f228243b6e3ac",
30+
"url": "https://github.com/numtide/treefmt-nix/archive/49dc4a92b02b8e68798abd99184f228243b6e3ac.tar.gz",
31+
"hash": "0qlhb0xvcc3al19irclxk7vnppd9m6b5vi3nbjb9dylphs306x1p"
2032
}
2133
},
2234
"version": 3

0 commit comments

Comments
 (0)