diff --git a/docs/CONTRIBUTORS.rst b/docs/CONTRIBUTORS.rst index 302c8c205b..bf68594158 100644 --- a/docs/CONTRIBUTORS.rst +++ b/docs/CONTRIBUTORS.rst @@ -114,7 +114,7 @@ Auto-formatting can be done on the command line: :: $ # TODO: configure black and isort args in pyproject.toml (see #1161) - $ black --line-length 80 tuf/api + $ black $ isort --line-length 80 --profile black -p tuf tuf/api or via source code editor plugin diff --git a/pyproject.toml b/pyproject.toml index 245e2cdf5f..be5e723804 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,13 @@ +# Build-system section [build-system] requires = ["setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" +# Black section +# Read more here: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file +[tool.black] +line-length=80 + # Pylint section # Minimal pylint configuration file for Secure Systems Lab Python Style Guide: diff --git a/tox.ini b/tox.ini index 767b1b4a86..b06150ea57 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,7 @@ changedir = {toxinidir} commands = # Use different configs for new (tuf/api/*) and legacy code # TODO: configure black and isort args in pyproject.toml (see #1161) - black --check --diff --line-length 80 tuf/api tuf/ngclient + black --check --diff tuf/api tuf/ngclient isort --check --diff --line-length 80 --profile black -p tuf tuf/api tuf/ngclient pylint -j 0 tuf/api tuf/ngclient --rcfile=pyproject.toml