Skip to content

Commit 7956561

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Pep8 environment to run on delta code only"
2 parents 7a0845e + 095edbc commit 7956561

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

tools/fast8.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
cd $(dirname "$0")/..
4+
CHANGED=$(git diff --name-only HEAD~1 | tr '\n' ' ')
5+
6+
# Skip files that don't exist
7+
# (have been git rm'd)
8+
CHECK=""
9+
for FILE in $CHANGED; do
10+
if [ -f "$FILE" ]; then
11+
CHECK="$CHECK $FILE"
12+
fi
13+
done
14+
15+
diff -u --from-file /dev/null $CHECK | flake8 --diff

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ deps = -r{toxinidir}/test-requirements.txt
1111
commands = ostestr {posargs}
1212
whitelist_externals = ostestr
1313

14+
[testenv:fast8]
15+
# Use same environment directory as pep8 env to save space and install time
16+
envdir = {toxworkdir}/pep8
17+
commands =
18+
{toxinidir}/tools/fast8.sh
19+
1420
[testenv:pep8]
1521
commands =
1622
flake8

0 commit comments

Comments
 (0)