tangled
alpha
login
or
join now
oeiuwq.com
/
checkmate
0
fork
atom
A flake checker (treefmt & nix-unit) for testing other flakes with zero dependencies.
0
fork
atom
overview
issues
pulls
pipelines
comments on runnig checks locally
oeiuwq.com
1 year ago
61e2fcba
c3ede7ad
+21
-3
3 changed files
expand all
collapse all
unified
split
README.md
tests.nix
treefmt.nix
+16
-1
README.md
···
6
6
7
7
- nix-unit - The flake being checked (ie, `inputs.target`) is expected to expose `flakeModules.checkmate`:
8
8
9
9
-
```nix
9
9
+
````nix
10
10
# Example
11
11
flakeModules.checkmate =
12
12
{ inputs, ... }:
···
30
30
}
31
31
);
32
32
};
33
33
+
34
34
+
### Running treefmt on your code
35
35
+
36
36
+
```shell
37
37
+
# see if code is formatted
38
38
+
nix run github:vic/checkmate#check-treefmt --override-input target path:$PWD -L
39
39
+
40
40
+
# formatting your code
41
41
+
nix run github:vic/checkmate#treefmt -- $PWD
42
42
+
````
43
43
+
44
44
+
### Running nix-unit tests locally
45
45
+
46
46
+
```shell
47
47
+
nix run github:vic/checkmate#check-nix-unit --override-input target path:$PWD -L
33
48
```
34
49
35
50
### CI Usage
+3
-1
tests.nix
···
9
9
];
10
10
11
11
perSystem = (
12
12
-
{ ... }:
12
12
+
{ self', ... }:
13
13
{
14
14
nix-unit.allowNetwork = true;
15
15
nix-unit.inputs = inputs;
16
16
+
17
17
+
packages.check-nix-unit = self'.checks.nix-unit;
16
18
}
17
19
);
18
20
}
+2
-1
treefmt.nix
···
15
15
treefmt-check = treefmt.config.build.check inputs.target;
16
16
in
17
17
{
18
18
-
packages.checkmate-treefmt = treefmt-wrapper;
18
18
+
packages.treefmt = treefmt-wrapper;
19
19
+
packages.check-treefmt = treefmt-check;
19
20
checks.checkmate-treefmt = treefmt-check;
20
21
lib.checkmate-treefmt = treefmt.config.build.check;
21
22
}