diff options
| author | Sheel Rana <ranasheel2000@gmail.com> | 2016-05-12 00:53:23 +0530 |
|---|---|---|
| committer | Sheel Rana <ranasheel2000@gmail.com> | 2016-05-12 00:55:10 +0530 |
| commit | 095edbc3678dd9d7cc630becf098f3626fe3237d (patch) | |
| tree | 98577264e7166e957d70f21c1d5f8835f8ad6e18 | |
| parent | 56680c83fe8450a1e0175a10329a549507329dfb (diff) | |
| download | python-openstackclient-095edbc3678dd9d7cc630becf098f3626fe3237d.tar.gz | |
Pep8 environment to run on delta code only
Currently tox -epep8 will run flake8 on whole code.
To make this fast, flake8 support is added for only
updated(delta) code.
Same can be run by "tox -efast8".
Change-Id: I9c55fed32ae3060c21ec278398e9e07fb4a0fe13
Implements: BP tox-pep8-diff-part-only
| -rwxr-xr-x | tools/fast8.sh | 15 | ||||
| -rw-r--r-- | tox.ini | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tools/fast8.sh b/tools/fast8.sh new file mode 100755 index 00000000..2b3e22ab --- /dev/null +++ b/tools/fast8.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cd $(dirname "$0")/.. +CHANGED=$(git diff --name-only HEAD~1 | tr '\n' ' ') + +# Skip files that don't exist +# (have been git rm'd) +CHECK="" +for FILE in $CHANGED; do + if [ -f "$FILE" ]; then + CHECK="$CHECK $FILE" + fi +done + +diff -u --from-file /dev/null $CHECK | flake8 --diff @@ -11,6 +11,12 @@ deps = -r{toxinidir}/test-requirements.txt commands = ostestr {posargs} whitelist_externals = ostestr +[testenv:fast8] +# Use same environment directory as pep8 env to save space and install time +envdir = {toxworkdir}/pep8 +commands = + {toxinidir}/tools/fast8.sh + [testenv:pep8] commands = flake8 |
