diff options
author | Ben Sima <ben@bsima.me> | 2023-08-22 11:46:08 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2023-08-22 11:46:08 -0400 |
commit | c13e829e145daf96ea2be9b4d35fc2a94a1b33bd (patch) | |
tree | beaec3d7c830b5c59561f1a225ea37ac1731c54e /Biz/Bild | |
parent | 9eac46cfeddc65938b3cc946629a9c3d93ac35ee (diff) |
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.
Diffstat (limited to 'Biz/Bild')
-rw-r--r-- | Biz/Bild/Builder.nix | 11 |
1 files changed, 8 insertions, 3 deletions
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 ''; |