Skip to content

Commit

Permalink
fix: filtering deleted files in format and lint commands (#980)
Browse files Browse the repository at this point in the history
  • Loading branch information
elisalimli authored Apr 30, 2024
1 parent 596a7c5 commit 451de42
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/superagent/lint-and-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# getting changed files (only staged)
changes=$(git diff --name-only --cached | grep '^libs/superagent.*\.py$' | sed 's|^libs/superagent/||')

# Filter deleted files
changes=$(echo "$changes" | while read -r file; do [ -e "$file" ] && echo "$file"; done)
lint() {
poetry run black $changes
# sort imports
Expand Down

0 comments on commit 451de42

Please sign in to comment.