The ubuntu-pro-client
code base is formatted using
black, and imports are sorted with
isort. When making changes, you should ensure
that your code is blackened and isorted, or it will be rejected by CI.
Formatting the whole codebase is as simple as running:
black uaclient/
isort uaclient/
To make it easier to avoid committing incorrectly formatted code, this
repository includes configuration for pre-commit
which will stop you from committing any code that isn't blackened. To install
the project's pre-commit hook, install pre-commit
and run:
pre-commit install
To install black
and pre-commit
at the appropriate versions for
the project, you should install them via dev-requirements.txt
.