summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2021-12-15 20:16:38 -0600
committerGitHub <noreply@github.com>2021-12-15 19:16:38 -0700
commitbae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf (patch)
tree1fbb3269fc87e39832e3286ef42eefd2b23fcd44 /tox.ini
parent2bcf4fa972fde686c2e3141c58e640640b44dd00 (diff)
downloadvyos-cloud-init-bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf.tar.gz
vyos-cloud-init-bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf.zip
Adopt Black and isort (SC-700) (#1157)
Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini28
1 files changed, 24 insertions, 4 deletions
diff --git a/tox.ini b/tox.ini
index ff888266..034ee9a4 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py3, xenial-dev, flake8, pylint
+envlist = py3, xenial-dev, flake8, pylint, black, isort
recreate = True
[testenv]
@@ -29,6 +29,27 @@ deps =
-r{toxinidir}/integration-requirements.txt
commands = {envpython} -m pylint {posargs:cloudinit tests tools}
+[testenv:black]
+basepython = python3
+deps =
+ # requirements
+ black==21.12b0
+commands = {envpython} -m black . --check
+
+[testenv:isort]
+basepython = python3
+deps =
+ isort==5.10.1
+commands = {envpython} -m isort . --check-only
+
+[testenv:format]
+basepython = python3
+deps =
+ black==21.12b0
+ isort==5.10.1
+commands =
+ {envpython} -m isort .
+ {envpython} -m black .
[testenv:py3]
basepython = python3
@@ -44,10 +65,9 @@ basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt
[flake8]
-# E226: missing whitespace around arithmetic operator
+# E203: whitespace before ':', doesn't adhere to pep8 or black formatting
# W503: line break before binary operator
-# W504: line break after binary operator
-ignore=E226,W503,W504
+ignore=E203,W503
exclude = .venv,.tox,dist,doc,*egg,.git,build,tools
per-file-ignores =
cloudinit/cmd/main.py:E402