Setup pre-commit

This commit is contained in:
Firepup Sixfifty 2025-01-21 13:57:33 -06:00
parent 99e8002266
commit 77216de123
Signed by: Firepup650
SSH key fingerprint: SHA256:cb8sEJwc0kQJ6/nMUhscWRe35itf0NFMdSKl3v4qt48
2 changed files with 13 additions and 0 deletions

7
.git-hooks/pre-commit Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
echo "Running pre-commit hook"
pre-commit run -a
git diff --name-only --cached | xargs git add
echo "Re-running pre-commit hook, to check for actual (non-formatting) errors"
pre-commit run -a

6
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,6 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
language_version: python3