From b94f66f02c6433d20d54ba44ef43158ff0555a28 Mon Sep 17 00:00:00 2001 From: Gavin Hughes <1315627+gavin-webstuff@users.noreply.github.com> Date: Fri, 17 Jul 2026 11:47:31 +0100 Subject: [PATCH] exclude tests from pre-commit checks --- scripts/git-hooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit index f57927b..732dd1b 100755 --- a/scripts/git-hooks/pre-commit +++ b/scripts/git-hooks/pre-commit @@ -55,7 +55,7 @@ if [ -f ".ddev/.env.anner" ]; then fi fi -STAGED_FILES=$(git diff --cached --name-only | grep -E "$FILES_PATTERN") +STAGED_FILES=$(git diff --cached --name-only | grep -vE "(^|/)tests(/|$)" | grep -E "$FILES_PATTERN") if [ -n "$STAGED_FILES" ]; then for FORBIDDEN_PATTERN in "${FORBIDDEN_PATTERNS[@]}"; do echo "$STAGED_FILES" | xargs grep --color --with-filename -n "$FORBIDDEN_PATTERN" \