Merge "Pep8 environment to run on delta code only"
This commit is contained in:
commit
795656184e
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
|
6
tox.ini
6
tox.ini
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user