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: I782c92c5d87cd55c007b919fb2680fdfd61c3b0c
This commit is contained in:
David Moreau Simard 2018-10-02 15:53:27 -05:00
parent 013324348c
commit f3e4d101e2
No known key found for this signature in database
GPG Key ID: CBEB466764A9E621
5 changed files with 32 additions and 10 deletions

View File

@ -1,7 +1,9 @@
- project:
check:
jobs:
- tox-format
- tox-pep8
gate:
jobs:
- tox-format
- tox-pep8

2
pyproject.toml Normal file
View File

@ -0,0 +1,2 @@
[tool.black]
line-length = 120

View File

@ -53,3 +53,25 @@ universal = 1
[pbr]
skip_authors = True
skip_changelog = True
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# E741, short ambiguous variable names
# H106 Dont 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

View File

@ -3,3 +3,5 @@ coverage
flake8
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
sphinx-rtd-theme
black==18.9b0 ; python_version >= '3.6' # Exact version for prerelease
isort

14
tox.ini
View File

@ -22,13 +22,7 @@ commands =
flake8 ara
bandit -r ara
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# E741, short ambiguous variable names
# H106 Dont 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
[testenv:format]
commands =
black --diff --check ara
isort --recursive --check-only --diff --virtual-env {envdir} ara