Objective
Run Black on your Python code to ensure it complies with the coding
style guide. Black is configured with --check --diff --quiet
rules.
How to use it
- Configure the black section of
pyproject.toml
in your repository's with your desired rules. - Include the Black template in your CI/CD configuration (see quick use above).
- If you need to customize the job, check the jobs customization.
Global Configuration of Black
To add configuration to black
shared with any other usage of black (such as manual run,
pre-commit, etc), you can use pyproject.toml
configuration file. Learn more
about pyproject
configuration files.
badge to your project README.md
Add a To display the use of Black in your project, you can add the following badge to your README.md:
<a href="https://github.com/psf/black">
<img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
</a>