Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # blacken the staged files
- for file in $(git diff --cached --name-only | grep -E '\.(py)$')
- do
- black "$file"
- $(git add "$file")
- done
- for file in $(git diff --cached --name-only | grep -E '\.(py)$')
- do
- flake8 "$file"
- if [ $? -ne 0 ]; then
- echo "flake8 failed on staged file '$file'. Please check your code and try again. To check output manually run flake8 $file"
- exit 1 # exit with failure status
- fi
- done
Add Comment
Please, Sign In to add comment