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
Commit 71a2da2d authored by Dorian Turba's avatar Dorian Turba
Browse files

edit code_quality README.md

parent 3592276c
No related branches found
No related tags found
No related merge requests found
......@@ -5,20 +5,6 @@
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.
### 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.
See this example:
```toml
[tool.black]
line-length = 100
```
## How to use it
1. Configure the black section of `pyproject.toml` in your repository's with your desired rules.
......@@ -26,6 +12,13 @@ line-length = 100
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.
## 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:
......
......@@ -4,30 +4,19 @@ Run [Flake8](https://flake8.pycqa.org/en/latest/) on your Python code to ensure
standards and to detect various errors such as syntax errors, semantic errors, and complex code.
Flake8 is a Python tool that glues together pycodestyle, pyflakes, and McCabe.
### Global Configuration of Flake8
To add configuration to `flake8` shared with any other usage of flake8 (such as manual run,
pre-commit, etc), you can use `.flake8` configuration file. Learn more
about [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) files.
See this example:
```ini
[flake8]
exclude = .git,__pycache__,venv,dist
max-complexity = 10
max-line-length = 100
```
This example sets the maximum line length to 100 characters, excludes the tests directory, and sets
the maximum complexity to 10.
## How to use it
1. Configure the `.flake8` file in your repository's root directory with your desired rules.
2. Include the flake8 template in your CI/CD configuration (see quick use above).
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 Flake8
To add configuration to `flake8` shared with any other usage of flake8 (such as manual run,
pre-commit, etc), you can use `.flake8` configuration file. Learn more
about [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) files.
## Add a <a href="https://flake8.pycqa.org/"><img alt="Code style: Flake8" src="https://img.shields.io/badge/Flake8-checks-blue"></a> Badge to your project README.md
To display the use of Flake8 in your project, you can add the following badge to your README.md:
......
......@@ -4,32 +4,6 @@ Run [isort](https://pycqa.github.io/isort/) on your Python code to automatically
your imports. isort separates imports into sections and by type. It's a helpful tool to ensure that
your code remains clean and readable.
### Global Configuration of isort
To add configuration to `isort` shared with any other usage of isort (such as manual run,
pre-commit, etc), you can use `pyproject.toml` configuration file or a dedicated `.isort.cfg`. Learn
more about [isort configuration](https://pycqa.github.io/isort/docs/configuration/config_files.html)
files.
Here's an example configuration for `pyproject.toml`:
```toml
[tool.isort]
profile = "black"
line_length = 100
```
And for `.isort.cfg`:
```cfg
[settings]
profile=hug
line_length=100
```
These examples set the line length to 100 characters and use the "black" profile, which is designed
to work well with the `black` auto-formatter.
## How to use it
1. Configure the `pyproject.toml` or `.isort.cfg` file in your repository's root directory with your
......@@ -38,6 +12,13 @@ to work well with the `black` auto-formatter.
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 isort
To add configuration to `isort` shared with any other usage of isort (such as manual run,
pre-commit, etc), you can use `pyproject.toml` configuration file or a dedicated `.isort.cfg`. Learn
more about [isort configuration](https://pycqa.github.io/isort/docs/configuration/config_files.html)
files.
## Add an <a href="https://pycqa.github.io/isort/"><img alt="Imports: isort" src="https://img.shields.io/badge/Imports-isort-yellow"></a> Badge to your project README.md
To display the use of isort in your project, you can add the following badge to your README.md:
......
......@@ -4,12 +4,6 @@ Run [mypy](https://mypy.readthedocs.io/en/stable/) on your Python code to perfor
checks, ensuring better code reliability and readability. `mypy` is a Python tool that checks the
types of variables, function return values, and more.
### Global Configuration of mypy
To add configuration to `mypy` shared with any other usage of mypy (such as manual run, pre-commit,
etc), you can use `mypy.ini`, `setup.cfg` or `pyproject.toml` configuration file. Learn more
about [mypy configuration](https://mypy.readthedocs.io/en/stable/config_file.html) files.
## How to use it
1. Configure the `mypy.ini`, `setup.cfg` or `pyproject.toml` file in your repository's root directory with your
......@@ -18,6 +12,13 @@ about [mypy configuration](https://mypy.readthedocs.io/en/stable/config_file.htm
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 mypy
To add configuration to `mypy` shared with any other usage of mypy (such as manual run, pre-commit,
etc), you can use `mypy.ini`, `setup.cfg` or `pyproject.toml` configuration file. Learn more
about [mypy configuration](https://mypy.readthedocs.io/en/stable/config_file.html) files.
## Add a <a href="https://mypy.readthedocs.io/"><img alt="Type Checked: mypy" src="https://img.shields.io/badge/mypy-checks-blue"></a> Badge to your project README.md
To display the use of mypy in your project, you can add the following badge to your README.md:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment