Fix flake8 tox.ini directive

Do not specify posargs on flake8 line in pep8 section, as it
breaks using 'tox -e pep8 HEAD~1' to check just code changed
in current change. While here change to match octavia tree
regarding enabled extensions.

Also fixed basepython warning now generated after removing
python2 code.

Trivialfix

Change-Id: Ib4326a1947845a229418b6b4213efc9f2bb12b32
This commit is contained in:
Brian Haley 2019-11-07 15:00:23 +08:00
parent 9e60548de8
commit 36902d90a4
1 changed files with 9 additions and 4 deletions

13
tox.ini
View File

@ -2,6 +2,7 @@
minversion = 2.5.0
envlist = docs,py37,pep8
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
@ -21,7 +22,7 @@ deps =
commands = stestr run {posargs}
[testenv:pep8]
commands = flake8 {posargs}
commands = flake8
doc8 --ignore-path doc/source/contributor/modules \
doc/source octavia_lib HACKING.rst README.rst
# Run security linter
@ -68,12 +69,16 @@ commands =
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
ignore =
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
# [H106]: Don't put vim configuration in source files
# [H203]: Use assertIs(Not)None to check for None
# [H204]: Use assert(Not)Equal to check for equality
# [H205]: Use assert(Greater|Less)(Equal) for comparison
# [H904]: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904
[hacking]
import_exceptions = octavia_lib.i18n