Skip to content

Commit

Permalink
build: Update pre-push hook to improve test file checks
Browse files Browse the repository at this point in the history
- Changed the diff filter to exclude deleted files
- Ensured only new or modified test files are checked
  • Loading branch information
jonrandahl committed Feb 14, 2025
1 parent 157be43 commit a36cc40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if echo "$BRANCH_NAME" | grep -q '^(rebase)|(production)*$'; then
fi

# Check for existence of "new or modified" test files
TEST_FILES="$(git diff --diff-filter=ACDM --name-only --cached | grep -E '(./test/*)$')"
RUBY_FILES="$(git diff --diff-filter=ACDM --name-only --cached | grep -E '(_test\.rb)$')"
TEST_FILES="$(git diff --diff-filter=d --name-only --cached | grep -E '(./test/*)$')"
RUBY_FILES="$(git diff --diff-filter=d --name-only --cached | grep -E '(_test\.rb)$')"

WORK_DONE=0

Expand Down

0 comments on commit a36cc40

Please sign in to comment.