add lefthook and fix justfile
Some checks failed
ci/woodpecker/push/tests Pipeline failed

Signed-off-by: Ivan Schaller <ivan@schaller.sh>
This commit is contained in:
Ivan Schaller 2023-06-22 09:14:38 +02:00
parent 25720385a4
commit 5d60669161
Signed by: olofvndrhr
GPG key ID: 2A6BE07D99C8C205
2 changed files with 13 additions and 3 deletions

View file

@ -83,13 +83,13 @@ test_shfmt:
@find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -d -i 4 -bn -ci -sr "{}" \+; @find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -d -i 4 -bn -ci -sr "{}" \+;
test_black: test_black:
@python3 -m black --check --diff . @python3 -m black --check --diff netbox_qrgen/
test_pyright: test_pyright:
@python3 -m pyright . @python3 -m pyright netbox_qrgen/
test_ruff: test_ruff:
@python3 -m ruff --diff . @python3 -m ruff --diff netbox_qrgen/
test_ci_conf: test_ci_conf:
@woodpecker-cli lint .woodpecker/ @woodpecker-cli lint .woodpecker/

10
lefthook.yml Normal file
View file

@ -0,0 +1,10 @@
pre-commit:
commands:
01_ruff:
stage_fixed: true
glob: "*.py"
run: python3 -m ruff --fix-only --exit-zero --silent {all_files}
02_black:
stage_fixed: true
glob: "*.py"
run: python3 -m black --quiet {all_files}