您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

lint.sh 460B

123456789101112131415161718
  1. #/usr/bin/env bash
  2. ERRORFILE="violations.txt"
  3. THRESHOLD=1050
  4. IGNORE="W292,E202"
  5. flake8 --ignore=$IGNORE oscar | perl -ple "s/: /: [E] /" | grep -v migrations > $ERRORFILE
  6. # Check that the number of violations is acceptable
  7. NUMERRORS=`cat $ERRORFILE | wc -l`
  8. if [ $NUMERRORS -gt $THRESHOLD ]
  9. then
  10. echo
  11. echo "Too many flake8 errors - maximum allowed is $THRESHOLD, found $NUMERRORS"
  12. echo
  13. echo "To fix, run 'make lint' and examine $ERRORFILE"
  14. exit 1
  15. fi