
The flake8 command (when run from the command line or via vim-flake8) seems to bypass the the normal pep8 [W]arning and [E]rror as well as py[F]lake checks if the project level tox.ini includes a select, but doesn't include them in it's select option (tested on flake8 v2.0 and v2.1). Somehow if hacking is installed these checks always run even if they're not explicitly listed in the select list - but adding them so flake8 works on our project even without hacking doesn't seem to cause any problems. Also The [flake8] section's "select" option in tox.ini doesn't seem to run all checks when presented with the space-comma seperated list. I had to pull out the bare except check (H201), because our hacking fix for the "H201 # noqa" hasn't been released to pypi yet (maybe hacking version 0.9.0?). As far as I know the Swift core development team is fully onboard with pep8, and the flake8 checks are mostly like "unused import" stuff - so I *think* this change is more about making the tool test what we want it too and not changing or adding any new requirements or expectations. Change-Id: Ia911c63745100cce182d5c5eb67b77e31c1e9b18
52 lines
1.3 KiB
INI
52 lines
1.3 KiB
INI
[tox]
|
|
envlist = py26,py27,pep8
|
|
minversion = 1.6
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install --allow-external netifaces --allow-insecure netifaces -U {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
NOSE_WITH_OPENSTACK=1
|
|
NOSE_OPENSTACK_COLOR=1
|
|
NOSE_OPENSTACK_RED=0.05
|
|
NOSE_OPENSTACK_YELLOW=0.025
|
|
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
|
NOSE_OPENSTACK_STDOUT=1
|
|
NOSE_WITH_COVERAGE=1
|
|
NOSE_COVER_BRANCHES=1
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands = nosetests {posargs:test/unit}
|
|
|
|
[testenv:cover]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
NOSE_WITH_COVERAGE=1
|
|
NOSE_COVER_BRANCHES=1
|
|
NOSE_COVER_HTML=1
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
|
|
|
[tox:jenkins]
|
|
downloadcache = ~/cache/pip
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
flake8
|
|
flake8 --filename=swift* bin
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
# it's not a bug that we aren't using all of hacking
|
|
# H102 -> apache2 license exists
|
|
# H103 -> license is apache
|
|
# H201 -> no bare excepts # add when hacking supports noqa
|
|
# H501 -> don't use locals() for str formatting
|
|
# H903 -> \n not \r\n
|
|
ignore = H
|
|
select = F,E,W,H102,H103,H501,H903
|
|
exclude = .venv,.tox,dist,doc,*egg
|
|
show-source = True
|