Skip to content
Permalink
Browse files

Exclude __init__.py when identifying test targets

  • Loading branch information
lovett committed Aug 27, 2019
1 parent 9300be7 commit 7aa2f1580d4498869f992150235d0d03f5aef542
Showing with 4 additions and 1 deletion.
  1. +4 −1 hooks/pre-commit
@@ -34,7 +34,10 @@ for STAGED_FILE in $(git diff --cached --name-only --diff-filter=dcr); do
TYPE="${PATH_PARTS[0]}"
NAME=${PATH_PARTS[1]%.*} # remove file extension
NAME=${NAME/_test/} # remove test prefix
TESTS_TO_RUN="$TESTS_TO_RUN $TYPE.$NAME"

if [[ "$NAME" != "__init__" ]]; then
TESTS_TO_RUN="$TESTS_TO_RUN $TYPE.$NAME"
fi
fi

if [[ "$FILE_EXTENSION" == "py" ]]; then

0 comments on commit 7aa2f15

Please sign in to comment.
You can’t perform that action at this time.