Skip to content

Commit

Permalink
fix: running format and linting commands for existing files only
Browse files Browse the repository at this point in the history
  • Loading branch information
elisalimli committed Apr 29, 2024
1 parent 596a7c5 commit 965c056
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 965c056

Please sign in to comment.