1
0
forked from clan/clan-core

clan-cli: add checks for black and ruff

This commit is contained in:
DavHau 2023-07-25 15:43:26 +02:00
parent 310bdacb9d
commit 2a31d785cf

View File

@ -41,7 +41,7 @@ let
propagatedBuildInputs =
dependencies
++ [ ];
passthru.tests = { inherit clan-tests clan-mypy; };
passthru.tests = { inherit clan-black clan-mypy clan-pytest clan-ruff; };
passthru.devDependencies = devDependencies;
postInstall = ''
installShellCompletion --bash --name clan \
@ -54,6 +54,14 @@ let
checkPython = python3.withPackages (_ps: devDependencies ++ dependencies);
clan-black = runCommand "${name}-black" { } ''
cp -r ${src} ./src
chmod +w -R ./src
cd src
${checkPython}/bin/black --check .
touch $out
'';
clan-mypy = runCommand "${name}-mypy" { } ''
cp -r ${src} ./src
chmod +w -R ./src
@ -62,7 +70,7 @@ let
touch $out
'';
clan-tests = runCommand "${name}-tests" { } ''
clan-pytest = runCommand "${name}-tests" { } ''
cp -r ${src} ./src
chmod +w -R ./src
cd src
@ -71,5 +79,13 @@ let
touch $out
'';
clan-ruff = runCommand "${name}-ruff" { } ''
cp -r ${src} ./src
chmod +w -R ./src
cd src
${pkgs.ruff}/bin/ruff check .
touch $out
'';
in
package