Run pre-commit via husky hook

This commit is contained in:
Henrik Hüttemann 2023-05-22 16:12:41 +02:00
parent a06ed05011
commit 18985caab8
No known key found for this signature in database
GPG Key ID: 9F7BD10E0A8A111E
2 changed files with 20 additions and 1 deletions

View File

@ -4,5 +4,25 @@
npm run format
npm run lint
# THIS PART is generated by pre-commit: https://pre-commit.com
# start templated
INSTALL_PYTHON=/usr/bin/python
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-commit)
# end templated
HERE="$(cd "$(dirname "$0")" && pwd)"
ARGS+=(--hook-dir "$HERE" -- "$@")
if [ -x "$INSTALL_PYTHON" ]; then
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
elif command -v pre-commit > /dev/null; then
exec pre-commit "${ARGS[@]}"
else
echo '`pre-commit` not found. Did you forget to activate your virtualenv?' 1>&2
exit 1
fi
### End of pre-commit py part
npm test
npm run compile

View File

@ -11,7 +11,6 @@ repos:
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker