Skip to content

Commit 5c76298

Browse files
committed
pseudo-lint is only run on files staged for commit
Why: A commit shouldn't have to fix problems unrelated to its main purpose.
1 parent 98d0a9a commit 5c76298

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.githooks/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ EOF
3939
exit 1
4040
fi
4141

42-
# runs pseudo-lint
43-
mix format --check-formatted '{lib,priv,test,config}/**/*.{ex,exs}'
42+
# runs pseudo-lint on staged files
43+
git diff --name-only --cached | grep -E ".*\.(ex|exs)$" | xargs mix format --check-formatted
4444

4545
PSEUDOLINT_STATUS=$?
4646
if [ "$PSEUDOLINT_STATUS" != "0" ]; then

0 commit comments

Comments
 (0)