Skip to content

Commit 965c056

Browse files
committed
fix: running format and linting commands for existing files only
1 parent 596a7c5 commit 965c056

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libs/superagent/lint-and-format.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# getting changed files (only staged)
44
changes=$(git diff --name-only --cached | grep '^libs/superagent.*\.py$' | sed 's|^libs/superagent/||')
55

6+
# Filter deleted files
7+
changes=$(echo "$changes" | while read -r file; do [ -e "$file" ] && echo "$file"; done)
8+
69
lint() {
710
poetry run black $changes
811
# sort imports

0 commit comments

Comments
 (0)