summaryrefslogtreecommitdiff
path: root/Biz/Lint.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2023-08-22 11:46:08 -0400
committerBen Sima <ben@bsima.me>2023-08-22 11:46:08 -0400
commitc13e829e145daf96ea2be9b4d35fc2a94a1b33bd (patch)
treebeaec3d7c830b5c59561f1a225ea37ac1731c54e /Biz/Lint.hs
parent9eac46cfeddc65938b3cc946629a9c3d93ac35ee (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/Lint.hs')
-rw-r--r--Biz/Lint.hs22
1 files changed, 21 insertions, 1 deletions
diff --git a/Biz/Lint.hs b/Biz/Lint.hs
index cba6aef..2742fae 100644
--- a/Biz/Lint.hs
+++ b/Biz/Lint.hs
@@ -5,6 +5,17 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- : out lint
+--
+-- these are actually runtime deps, but bild doesn't (yet) distinguish between
+-- rundeps and sysdeps:
+--
+-- : sys ormolu
+-- : sys hlint
+-- : sys black
+-- : sys ruff
+-- : sys deadnix
+-- : sys shellcheck
+-- : sys indent
module Biz.Lint (main) where
import Alpha
@@ -130,6 +141,14 @@ black =
fixArgs = Just []
}
+ruff :: Linter
+ruff =
+ Linter
+ { exe = "ruff",
+ checkArgs = ["check"],
+ fixArgs = Just ["check", "--fix"]
+ }
+
deadnix :: Linter
deadnix =
Linter
@@ -172,7 +191,8 @@ runOne mode root cwd path_ = results +> traverse_ printResult >> results
lint mode hlint path_
]
Just (Namespace _ Py) ->
- [ lint mode black path_
+ [ lint mode black path_,
+ lint mode ruff path_
]
Just (Namespace _ Sh) -> [lint mode shellcheck path_]
Just (Namespace _ Nix) -> [lint mode deadnix path_]