diff --git a/.gitignore b/.gitignore index b29f65217d..9d0648062f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ tests/htmlcov/* .python-version *~ *.tmp +.pre-commit-config.yaml # Debian generated files debian/.debhelper/* diff --git a/docs/CONTRIBUTORS.rst b/docs/CONTRIBUTORS.rst index 7c883d9df9..74abd39e19 100644 --- a/docs/CONTRIBUTORS.rst +++ b/docs/CONTRIBUTORS.rst @@ -5,8 +5,8 @@ Note: Development of TUF occurs on the "develop" branch of this repository. Contributions can be made by submitting GitHub pull requests. Submitted code should follow our `code style guidelines -`_, which provide -examples of what to do (or not to do) when writing Python code. +`_, which are +enforced with linters and auto-formatters (details below). Contributors must also indicate acceptance of the `Developer Certificate of Origin `_ (DCO) when making a contribution @@ -105,6 +105,26 @@ To work on the TUF project, it's best to perform a development install. $ pip install -r requirements-dev.txt +Auto-formatting +=============== + +CI/CD will check that new TUF code is formatted with `black +`__ and `isort `__. +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 + $ isort --line-length 80 --profile black -p tuf tuf/api + +or via source code editor plugin +[`black `__, +`isort `__] or +`pre-commit `__-powered git hooks +[`black `__, +`isort `__]. + + Testing =======