From bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf Mon Sep 17 00:00:00 2001 From: James Falcon Date: Wed, 15 Dec 2021 20:16:38 -0600 Subject: Adopt Black and isort (SC-700) (#1157) Applied Black and isort, fixed any linting issues, updated tox.ini and CI. --- tox.ini | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'tox.ini') 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 -- cgit v1.2.3