nix: setup linter to lint python files
This sets up the `ruff` linter for python code linting. Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
committed by
Steve Chavez
parent
8e35d543bd
commit
66a8d04610
@@ -8,6 +8,7 @@
|
|||||||
, hsie
|
, hsie
|
||||||
, nixpkgs-fmt
|
, nixpkgs-fmt
|
||||||
, python3Packages
|
, python3Packages
|
||||||
|
, ruff
|
||||||
, silver-searcher
|
, silver-searcher
|
||||||
, statix
|
, statix
|
||||||
, stylish-haskell
|
, stylish-haskell
|
||||||
@@ -64,10 +65,14 @@ let
|
|||||||
echo "Scanning nix files for unused code..."
|
echo "Scanning nix files for unused code..."
|
||||||
${deadnix}/bin/deadnix -f
|
${deadnix}/bin/deadnix -f
|
||||||
|
|
||||||
|
# ruff has gaps in scanning for unused code, so we use vulture
|
||||||
echo "Scanning python files for unused code..."
|
echo "Scanning python files for unused code..."
|
||||||
${silver-searcher}/bin/ag -l --vimgrep -g '\.l?py$' . \
|
${silver-searcher}/bin/ag -l --vimgrep -g '\.l?py$' . \
|
||||||
| xargs ${python3Packages.vulture}/bin/vulture --exclude docs/conf.py
|
| xargs ${python3Packages.vulture}/bin/vulture --exclude docs/conf.py
|
||||||
|
|
||||||
|
echo "Linting python files..."
|
||||||
|
${ruff}/bin/ruff check .
|
||||||
|
|
||||||
echo "Checking consistency of import aliases in Haskell code..."
|
echo "Checking consistency of import aliases in Haskell code..."
|
||||||
${hsie} check-aliases main src
|
${hsie} check-aliases main src
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user