diff --git a/docs/CONTRIBUTORS.rst b/docs/CONTRIBUTORS.rst index bf685941..54ef8a8d 100644 --- a/docs/CONTRIBUTORS.rst +++ b/docs/CONTRIBUTORS.rst @@ -113,9 +113,8 @@ CI/CD will check that new TUF code is formatted with `black Auto-formatting can be done on the command line: :: - $ # TODO: configure black and isort args in pyproject.toml (see #1161) $ black - $ isort --line-length 80 --profile black -p tuf tuf/api + $ isort or via source code editor plugin [`black `__, diff --git a/pyproject.toml b/pyproject.toml index be5e7238..339f2416 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,13 @@ build-backend = "setuptools.build_meta" [tool.black] line-length=80 +# Isort section +# Read more here: https://pycqa.github.io/isort/docs/configuration/config_files.html +[tool.isort] +profile="black" +line_length=80 +known_first_party = ["tuf"] + # Pylint section # Minimal pylint configuration file for Secure Systems Lab Python Style Guide: diff --git a/tox.ini b/tox.ini index b06150ea..a6e0d765 100644 --- a/tox.ini +++ b/tox.ini @@ -40,9 +40,8 @@ commands = 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 tuf/api tuf/ngclient - isort --check --diff --line-length 80 --profile black -p tuf tuf/api tuf/ngclient + isort --check --diff tuf/api tuf/ngclient pylint -j 0 tuf/api tuf/ngclient --rcfile=pyproject.toml # NOTE: Contrary to what the pylint docs suggest, ignoring full paths does