Created
June 7, 2019 08:40
-
-
Save graeme-winter/579fd11893fb8d85a310faf7e5df2c1a to your computer and use it in GitHub Desktop.
Run flake8 comparing current branch to master (ignoring Python2/3 xrange; cmp)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BRANCH=$(git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') | |
CHANGED_FILES=$(git diff --name-only master...${BRANCH} -- "*.py") | |
[ -z "${CHANGED_FILES}" ] && echo There are no relevant changes. Skipping test. && exit 0 | |
echo Running flake8 on changed files: | |
flake8 --select=E711,E712,E713,E714,E721,E722,E901,F401,F402,F403,F632,F811,F812,F821,F822,F841,F901,W191,W602,W603,W604,W605,W606 $CHANGED_FILES | grep -v "'xrange'" | grep -v "'cmp'" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on travis configuration from @Anthchirp