From c13e829e145daf96ea2be9b4d35fc2a94a1b33bd Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 22 Aug 2023 11:46:08 -0400 Subject: Replace pylint with ruff Ruff is like a million times faster, and I mostly ignored pylint's suggestions anyway. I also took this opportunity to move lint tools into a runtime dependency on Lint.hs, which meant adding a wrapper to the Haskell builder, which was easy enough. This paves the way for proper rundeps in bild. --- Biz/Bild/Builder.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Biz/Bild') diff --git a/Biz/Bild/Builder.nix b/Biz/Bild/Builder.nix index 342569b..8f42733 100644 --- a/Biz/Bild/Builder.nix +++ b/Biz/Bild/Builder.nix @@ -63,13 +63,18 @@ let haskell = stdenv.mkDerivation rec { inherit name src BIZ_ROOT preBuild; + nativeBuildInputs = [ makeWrapper ]; buildInputs = sysdeps_ ++ [ (bild.haskell.ghcWith (p: (lib.attrsets.attrVals target.langdeps p) )) ]; - installPhase = "install -D ${name} $out/bin/${name}"; buildPhase = compileLine; + installPhase = '' + install -D ${name} $out/bin/${name} + wrapProgram $out/bin/${name} \ + --prefix PATH : ${lib.makeBinPath sysdeps_} + ''; }; c = stdenv.mkDerivation rec { @@ -89,13 +94,13 @@ let inherit name src BIZ_ROOT; propagatedBuildInputs = [ (bild.python.pythonWith (_: langdeps_)) ] ++ sysdeps_; buildInputs = sysdeps_; - checkInputs = [(bild.python.pythonWith (p: with p; [black mypy pylint]))]; + checkInputs = [(bild.python.pythonWith (p: with p; [black mypy])) ruff]; checkPhase = '' check() { $@ || { echo "fail: $name: $3"; exit 1; } } check python -m black --quiet --exclude 'setup\.py$' --check . - check python -m pylint --errors-only . + check ${ruff}/bin/ruff check . check python -m mypy --strict --no-error-summary --exclude 'setup\.py$' . check python -m ${mainModule} test ''; -- cgit v1.2.3