We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fad2ef commit 51861f8Copy full SHA for 51861f8
1 file changed
.git-hooks/pre-commit
@@ -7,6 +7,15 @@ cd "$PROJECT_ROOT" || exit 1
7
STAGED_PYTHON_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$')
8
STAGED_PRETTIER_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.md$' -e '\.jinja$' -e '\.html$' -e '\.css$')
9
10
+echo "Running tests..."
11
+pytest
12
+FORMAT_EXIT_CODE=$?
13
+if [ $FORMAT_EXIT_CODE -ne 0 ]; then
14
+ echo ""
15
+ echo "Commit aborted."
16
+ exit 1
17
+fi
18
+
19
if [ "$STAGED_PYTHON_FILES" ]; then
20
echo "Checking formatting with Ruff for staged Python files..."
21
ruff format --check $STAGED_PYTHON_FILES
0 commit comments