From 3ec802e036cba81860dc790b066f22641489110f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 1 Jan 2023 20:48:00 -0500 Subject: Add black and pylint --- Biz/Bild.nix | 7 +++++-- Biz/Lint.hs | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'Biz') diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 8fe20db..4be456f 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -148,13 +148,16 @@ rec { lolcat #nixops # fails to build ormolu - (private.nixpkgs.python3.withPackages(p: - with p; [ + (private.nixpkgs.python3.withPackages(p: with p; [ transformers pytorch private.nixpkgs.python3Packages.bitsandbytes private.nixpkgs.python3Packages.accelerate + # lint tools: + black + pylint ])) + shellcheck wemux ]; diff --git a/Biz/Lint.hs b/Biz/Lint.hs index 0341954..39c42db 100644 --- a/Biz/Lint.hs +++ b/Biz/Lint.hs @@ -131,6 +131,14 @@ pylint = fixArgs = Nothing } +black :: Linter +black = + Linter + { exe = "black", + checkArgs = ["--check"], + fixArgs = Just [] + } + deadnix :: Linter deadnix = Linter @@ -169,7 +177,7 @@ runOne mode root cwd path_ = results +> traverse_ printResult >> results [ lint mode ormolu path_, lint mode hlint path_ ] - Just (Namespace _ Py) -> [pure <| NoOp path_] + Just (Namespace _ Py) -> [lint mode pylint path_, lint mode black path_] Just (Namespace _ Sh) -> [lint mode shellcheck path_] Just (Namespace _ Nix) -> [lint mode deadnix path_] Just (Namespace _ Scm) -> [pure <| NoOp path_] -- cgit v1.2.3