ci: add nix code formatting check

This commit is contained in:
zimbatm 2019-12-12 17:26:18 +01:00
parent 3f1af1a94f
commit 2d916a5255
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
3 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,7 @@
test:
script:
- nix-build --no-out-link --show-trace tests
nixpkgs-fmt:
script:
- ./check-fmt

10
check-fmt Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash
#
# Just because the nixpkgs-fmt error message is not super readable. Used by
# CI.
if ! nixpkgs-fmt --check . ; then
echo 'run `nixpkgs-fmt .` to fix it'
exit 1
fi

View file

@ -6,5 +6,6 @@ in
pkgs.mkShell {
buildInputs = [
poetry
pkgs.nixpkgs-fmt
];
}