Skip to content

Commit 83578df

Browse files
committed
chore: don't format deleted files in pre-commit
1 parent 7ce3eca commit 83578df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
. "$(dirname "$0")/_/husky.sh"
44

5-
STAGED_TS_FILES=$(git diff --staged --name-only | grep '\.ts$' | xargs)
6-
STAGED_SOL_FILES=$(git diff --staged --name-only | grep '\.sol$' | xargs)
5+
STAGED_TS_FILES=$(git diff --staged --diff-filter=ad --name-only | grep '\.ts$' | xargs)
6+
STAGED_SOL_FILES=$(git diff --staged --diff-filter=ad --name-only | grep '\.sol$' | xargs)
77

88
if [ -n "$STAGED_SOL_FILES" ]; then
99
yarn prettier --config .prettierrc.json --write $STAGED_SOL_FILES

0 commit comments

Comments
 (0)