From 469e69e8b8f451ea887729311091def8489dd63c Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Tue, 21 Jan 2025 14:03:20 -0600 Subject: [PATCH] Setup pre-commit --- .git-hooks/pre-commit | 7 +++++++ .pre-commit-config.yaml | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100755 .git-hooks/pre-commit create mode 100644 .pre-commit-config.yaml diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit new file mode 100755 index 0000000..9757c73 --- /dev/null +++ b/.git-hooks/pre-commit @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c9b64f4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 24.10.0 + hooks: + - id: black + language_version: python3