You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lint.sh 676B

123456789101112131415161718192021
  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. # Run flake8 and convert the output into a format that the "violations" plugin
  7. # for Jenkins/Hudson can understand. Ignore warnings from migrations we we don't
  8. # really care about those.
  9. ERROR_FILE="violations.txt"
  10. THRESHOLD=0
  11. flake8 --max-complexity=10 oscar | perl -ple "s/: /: [E] /" > $ERROR_FILE
  12. # Check that the number of violations is acceptable
  13. NUMERRORS=`cat $ERROR_FILE | wc -l`
  14. if [ $NUMERRORS -gt $THRESHOLD ]
  15. then
  16. echo "The following flake8 errors need to be fixed"
  17. cat $ERROR_FILE
  18. exit 1
  19. fi