Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
README.md 1.39 KiB
Newer Older
[![Black Logo](https://raw.githubusercontent.com/psf/black/main/docs/_static/logo2-readme.png)](https://black.readthedocs.io/en/stable/)

Dorian Turba's avatar
Dorian Turba committed
## Objective

Run [Black](https://github.com/psf/black) on your Python code to ensure it complies with the coding
style guide. Black is configured with `--check --diff --quiet` rules.

Dorian Turba's avatar
Dorian Turba committed
## How to use it

Dorian Turba's avatar
Dorian Turba committed
1. Configure the black section of `pyproject.toml` in your repository's with your desired rules.
2. Include the Black template in your CI/CD configuration (see quick use above).
Dorian Turba's avatar
Dorian Turba committed
3. If you need to customize the job, check
   the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-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](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/)
configuration files.

Dorian Turba's avatar
Dorian Turba committed
## Add a <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> badge to your project README.md

To display the use of Black in your project, you can add the following badge to your README.md:
```markdown
<a href="https://github.com/psf/black">
    <img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
</a>
```