Skip to content

Commit

Permalink
checks.nix: Refer flake root using self
Browse files Browse the repository at this point in the history
Signed-off-by: Henri Rosten <[email protected]>
  • Loading branch information
henrirosten committed Nov 18, 2024
1 parent bdc42bc commit fda27a0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions nix/checks.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# SPDX-FileCopyrightText: 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
_: {
{ self, ... }:
{
perSystem =
{ pkgs, ... }:
{
checks = {
reuse = pkgs.runCommandLocal "reuse-lint" { buildInputs = [ pkgs.reuse ]; } ''
cd ${../.}
cd ${self.outPath}
reuse lint
touch $out
'';
pycodestyle =
pkgs.runCommandLocal "pycodestyle" { nativeBuildInputs = [ pkgs.python3.pkgs.pycodestyle ]; }
''
cd ${../.}
cd ${self.outPath}
pycodestyle --max-line-length 90 $(find . -type f -name "*.py" ! -path "*result*" ! -path "*eggs*")
touch $out
'';
Expand All @@ -29,18 +30,18 @@ _: {
];
}
''
cd ${../.}
cd ${self.outPath}
export HOME=/tmp
pylint --enable=useless-suppression -rn $(find . -type f -name "*.py" ! -path "*result*" ! -path "*eggs*")
touch $out
'';
black = pkgs.runCommandLocal "black" { nativeBuildInputs = [ pkgs.python3.pkgs.black ]; } ''
cd ${../.}
cd ${self.outPath}
black -q $(find . -type f -name "*.py" ! -path "*result*" ! -path "*eggs*")
touch $out
'';
terraform-fmt = pkgs.runCommandLocal "terraform-fmt" { nativeBuildInputs = [ pkgs.terraform ]; } ''
cd ${../.}
cd ${self.outPath}
terraform fmt -check -recursive
touch $out
'';
Expand Down

0 comments on commit fda27a0

Please sign in to comment.