Use flake8 for testing

Start using flake8 for style guide enforcement.

Change-Id: I9d7c89498c10e682acf0f75bad20dfd4bb6152b5
This commit is contained in:
Riccardo Pittau 2019-12-17 14:57:16 +01:00
parent 4f9103d5a7
commit 90d02c0a03
2 changed files with 14 additions and 4 deletions

View File

@ -9,3 +9,4 @@ stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4
testtools>=2.2.0
oslotest>=3.2.0 # Apache-2.0
flake8-import-order>=0.13 # LGPLv3

17
tox.ini
View File

@ -22,6 +22,7 @@ sitepackages = True
[testenv:pep8]
whitelist_externals = bash
commands = flake8
[testenv:cover]
setenv =
@ -40,11 +41,19 @@ commands = python setup.py build_sphinx
commands = {posargs}
[flake8]
exclude = .venv,.tox,dist,doc,*.egg,build
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
show-source = true
[pep8]
ignore = E731,E226,E123
# E129 visually indented line with same indent as next logical line
# E731 do not assign a lambda expression, use a def
# W504 line break after binary operator
ignore = E129,E731,W504
# 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
import-order-style = pep8
[testenv:lower-constraints]
deps =