Skip to content

Commit

Permalink
fix: Use treefmt to run black
Browse files Browse the repository at this point in the history
​
Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee authored and flokli committed Nov 15, 2023
1 parent 7f6fa45 commit 5b282d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
11 changes: 0 additions & 11 deletions nix/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
}: {
checks =
{
black =
pkgs.runCommandLocal "black" {
nativeBuildInputs = [pkgs.python3.pkgs.black];
} ''
cd ${../.}
for py in $(find . -name "*.py" ! -path "*venv*" ! -path "*eggs*"); do
echo "$py:"
black --check $py
done
touch $out
'';
# checks that copyright headers are compliant
# todo this could be moved into a shared flake
reuse =
Expand Down
3 changes: 2 additions & 1 deletion nix/treefmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

programs = {
alejandra.enable = true; # nix formatter https://github.com/kamadorueda/alejandra
black.enable = true; # lints python https://github.com/psf/black
deadnix.enable = true; # removes dead nix code https://github.com/astro/deadnix
statix.enable = true; # prevents use of nix anti-patterns https://github.com/nerdypepper/statix
shellcheck.enable = true; # lints shell scripts https://github.com/koalaman/shellcheck
statix.enable = true; # prevents use of nix anti-patterns https://github.com/nerdypepper/statix
};
};

Expand Down

0 comments on commit 5b282d0

Please sign in to comment.