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

lint.sh 824B

123456789101112131415161718192021222324
  1. #/usr/bin/env bash
  2. #
  3. # Run static analysis of the codebase
  4. #
  5. # This is run on Travis to ensure that pull requests conform to the project coding standards.
  6. # Ideally, this figure should be 0. But to keep the amount of "Fix PEP8" commits
  7. # low, we only fail Travis after a certain amount of warnings have accumulated
  8. THRESHOLD=15
  9. # Run flake8 and convert the output into a format that the "violations" plugin
  10. # for Jenkins/Hudson can understand.
  11. # flake8 is configured in [flake8] section in tox.ini
  12. ERROR_FILE="violations.txt"
  13. flake8 oscar | perl -ple "s/: /: [E] /" > $ERROR_FILE
  14. cat $ERROR_FILE
  15. # Check that the number of violations is acceptable
  16. NUMERRORS=`cat $ERROR_FILE | wc -l`
  17. if [ $NUMERRORS -gt $THRESHOLD ]
  18. then
  19. echo "Too many flake8 errors - maximum allowed is $THRESHOLD, found $NUMERRORS"
  20. exit 1
  21. fi