Add zuul job to run tox-format environment for executing black and isort
This will allow us to have more consistent and clean code. Change-Id: I8a49053d016c52b7b44136a6a8f36f9ad12675c3
This commit is contained in:
parent
b1dc3a0944
commit
001112df9f
|
@ -1,7 +1,9 @@
|
||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
|
- tox-format
|
||||||
- tox-pep8
|
- tox-pep8
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
|
- tox-format
|
||||||
- tox-pep8
|
- tox-pep8
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[tool.black]
|
||||||
|
line-length = 120
|
22
setup.cfg
22
setup.cfg
|
@ -53,3 +53,25 @@ universal = 1
|
||||||
[pbr]
|
[pbr]
|
||||||
skip_authors = True
|
skip_authors = True
|
||||||
skip_changelog = True
|
skip_changelog = True
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
# E123, E125 skipped as they are invalid PEP-8.
|
||||||
|
# E741, short ambiguous variable names
|
||||||
|
# H106 Don’t put vim configuration in source files
|
||||||
|
# H203 Use assertIs(Not)None to check for None
|
||||||
|
max-line-length = 120
|
||||||
|
ignore = E123,E125,E741
|
||||||
|
enable-extensions=H106,H203
|
||||||
|
show-source = True
|
||||||
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||||
|
|
||||||
|
[isort]
|
||||||
|
known_first_party = ara
|
||||||
|
default_section = THIRDPARTY
|
||||||
|
skip = build,.git,.tox,.cache,.venv
|
||||||
|
not_skip = __init__.py
|
||||||
|
multi_line_output=3
|
||||||
|
include_trailing_comma=True
|
||||||
|
force_grid_wrap=0
|
||||||
|
combine_as_imports=True
|
||||||
|
line_length=88
|
||||||
|
|
|
@ -3,3 +3,5 @@ coverage
|
||||||
flake8
|
flake8
|
||||||
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
|
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
|
||||||
sphinx-rtd-theme
|
sphinx-rtd-theme
|
||||||
|
black==18.9b0 ; python_version >= '3.6' # Exact version for prerelease
|
||||||
|
isort
|
||||||
|
|
14
tox.ini
14
tox.ini
|
@ -22,13 +22,7 @@ commands =
|
||||||
flake8 ara
|
flake8 ara
|
||||||
bandit -r ara
|
bandit -r ara
|
||||||
|
|
||||||
[flake8]
|
[testenv:format]
|
||||||
# E123, E125 skipped as they are invalid PEP-8.
|
commands =
|
||||||
# E741, short ambiguous variable names
|
black --diff --check ara
|
||||||
# H106 Don’t put vim configuration in source files
|
isort --recursive --check-only --diff --virtual-env {envdir} ara
|
||||||
# H203 Use assertIs(Not)None to check for None
|
|
||||||
max-line-length = 120
|
|
||||||
ignore = E123,E125,E741
|
|
||||||
enable-extensions=H106,H203
|
|
||||||
show-source = True
|
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
|
||||||
|
|
Loading…
Reference in New Issue