summaryrefslogtreecommitdiff
path: root/checks.nix
blob: 93d387f88795aa29981cfa1803b7e2189eb00c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
self: {
  lib,
  runCommand,
  system,
  actionlint,
  fd,
  statix,
  nil,
  ...
}: let
  formatter = self.formatter.${system};
in {
  check-actionlint = runCommand "check-actionlint" {} ''
    ${lib.getExe actionlint} ${./.github/workflows}/*

    touch $out
  '';

  check-nil = runCommand "check-nil" {} ''
    cd ${./.}
    ${lib.getExe fd} . -e 'nix' | while read -r file; do
      ${lib.getExe nil} diagnostics "$file"
    done

    touch $out
  '';

  check-statix = runCommand "check-statix" {} ''
    ${lib.getExe statix} check ${./.}
    touch $out
  '';

  "check-${formatter.pname}" = runCommand "check-${formatter.pname}" {} ''
    ${lib.getExe formatter} --check ${./.}
    touch $out
  '';
}