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

remove ruff

parent 2531e10b
No related branches found
No related tags found
No related merge requests found
Pipeline #32950 canceled
......@@ -9,7 +9,6 @@ include:
- local: 'templates/python/code_quality/isort/isort.yml'
- local: 'templates/python/code_quality/mypy/mypy.yml'
- local: 'templates/python/code_quality/pre-commit/pre-commit.yml'
- local: 'templates/python/code_quality/ruff/ruff.yml'
- local: 'templates/python/dependency_management/requirements-compile/requirements-compile.yml'
python_install:
......@@ -54,12 +53,6 @@ mypy:
variables:
PROJECT_PATH: "tests/mypy_project"
ruff:
stage: templates
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/ruff_project"
requirements-compile:
stage: templates
needs: [ "python_install" ]
......
files:
template: ../templates/python/code_quality/ruff/ruff.yml
documentation: ../templates/python/code_quality/ruff/README.md
data:
description: "Run ruff on your repository"
icon:
public: true
labels:
- Lint
- Utilities
- Code Quality
- Python
license: MIT
deprecated: false
# ruff template
## Objective
Run [Ruff](https://github.com/astral-sh/ruff), an extremely fast Python linter, on your Python
code. This tool is written in Rust, and it is designed to quickly analyze your Python code to detect
various syntax and stylistic errors.
## How to use it
1. Configure the `pyproject.toml` file in your repository's root directory with your desired rules.
2. Include the Ruff template in your GitLab CI/CD configuration.
3. If you need to customize the job, refer to
the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization)
documentation.
## Variables
| Name | Description | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. | `"pip install ruff"` |
### Global Configuration of Ruff
To add configuration to `ruff` that is shared with any other usage of Ruff (such as manual run,
pre-commit, etc), you can use a `pyproject.toml`, `ruff.toml`, or `.ruff.toml` configuration file in
your project's root directory. Learn more
about [ruff configuration](https://beta.ruff.rs/docs/configuration/) files.
## Add an official [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) badge to your project README.md
To display the use of Ruff in your project, you can add the following badge to your README.md:
```markdown
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
```
A more "classic" version of the badge ([![Code style: Ruff](https://img.shields.io/badge/Linter-Ruff-blue)](https://github.com/astral-sh/ruff)) is also available:
```markdown
[![Ruff](https://img.shields.io/badge/Linter-Ruff-blue)](https://github.com/astral-sh/ruff)
```
include:
- remote: 'https://gitlab.com/dorianturba-templates/r2devops_catalog/-/raw/main/templates/python/partial/python_install/python_install.yml'
ruff:
extends:
- .python_install
stage: code_quality
variables:
PYTHON_SETUP: "pip install ruff"
script:
- !reference [.python_install, script]
- ruff check ${PROJECT_PATH}
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
name = "ruff_project"
version = "0.1.0"
authors = [
{email = "author.name@example.com", name = "Author Name"},
]
description = "A description of what the package is for."
from ruff_project.main import main
__all__ = ["main"]
"""Sample main module."""
def main() -> bool:
"""Sample main function."""
print("Hello, world!")
return True
if __name__ == "__main__":
main()
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