diff --git a/libs/superagent/lint-and-format.sh b/libs/superagent/lint-and-format.sh index 523a7212a..4dba136d0 100755 --- a/libs/superagent/lint-and-format.sh +++ b/libs/superagent/lint-and-format.sh @@ -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