bootstrap/specs/poetry/template/.githooks/pre-commit

14 lines
234 B
Plaintext
Raw Normal View History

2023-11-26 22:31:00 +00:00
#!/usr/bin/env bash
set -e
filesToFormat=$(
git --no-pager diff --name-status --no-color --cached | \
awk '$1 != "D" && $2 ~ /\.py$/ {print $NF}'
)
for path in $filesToFormat
do
2023-11-27 20:07:21 +00:00
black --quiet "$path"
git add "$path"
2023-11-26 22:31:00 +00:00
done;