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:
|
||||
check:
|
||||
jobs:
|
||||
- tox-format
|
||||
- tox-pep8
|
||||
gate:
|
||||
jobs:
|
||||
- tox-format
|
||||
- tox-pep8
|
||||
|
2
pyproject.toml
Normal file
2
pyproject.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[tool.black]
|
||||
line-length = 120
|
22
setup.cfg
22
setup.cfg
@ -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 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
|
||||
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
14
tox.ini
@ -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 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
|
||||
[testenv:format]
|
||||
commands =
|
||||
black --diff --check ara
|
||||
isort --recursive --check-only --diff --virtual-env {envdir} ara
|
||||
|
Loading…
x
Reference in New Issue
Block a user