diff --git a/python/code_quality/black/README.md b/python/code_quality/black/README.md index 4dbf0716a5ff7f2da1bafdf7fe558ea242dc602c..3ec29ea78385724a61603093e29dc282197e1ee1 100644 --- a/python/code_quality/black/README.md +++ b/python/code_quality/black/README.md @@ -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: diff --git a/python/code_quality/flake8/README.md b/python/code_quality/flake8/README.md index 2232eb7c770c1c80782edb9f298db60847b271cf..a09bf0c2ed012fc6d18d69130e50ea01d96d8934 100644 --- a/python/code_quality/flake8/README.md +++ b/python/code_quality/flake8/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: diff --git a/python/code_quality/isort/README.md b/python/code_quality/isort/README.md index f386fb2e9c239b4bb6571a063fc50f04d476672a..d55061a51effe022b6cae7b3856cc427b5b559ba 100644 --- a/python/code_quality/isort/README.md +++ b/python/code_quality/isort/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: diff --git a/python/code_quality/mypy/README.md b/python/code_quality/mypy/README.md index 2cc6ee43326657208b2696ce646ebc7646fad67c..9a6b7a05062067f91a0ae96b0d0f36a43a9cdac0 100644 --- a/python/code_quality/mypy/README.md +++ b/python/code_quality/mypy/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: