Add fast8 ability to tox
This patch adds the same tox -efast8 check for testing pep8 violations against future patches. This is a bit faster, because it only tests what has changed in your current repo. Change-Id: I6eff6b5f57d947f8c1d0c832227d0f7e15d4bc6f
This commit is contained in:
parent
b34092bfab
commit
617108e49d
15
tools/fast8.sh
Executable file
15
tools/fast8.sh
Executable file
@ -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
|
7
tox.ini
7
tox.ini
@ -26,6 +26,10 @@ commands = flake8 {posargs}
|
||||
install_command = {[testenv:common-constraints]install_command}
|
||||
commands = flake8 {posargs}
|
||||
|
||||
[testenv:fast8]
|
||||
envdir = {toxworkdir}/pep8
|
||||
commands = {toxinidir}/tools/fast8.sh
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
@ -64,8 +68,7 @@ commands = oslo_debug_helper {posargs}
|
||||
|
||||
[flake8]
|
||||
# E123, E125 skipped as they are invalid PEP-8.
|
||||
|
||||
show-source = True
|
||||
ignore = E123,E125
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
||||
exclude=.venv,.git,.tox,dist,doc/*,*openstack/common*,*lib/python*,*egg,build
|
||||
|
Loading…
Reference in New Issue
Block a user