Skip to content
Snippets Groups Projects
Commit 27836479 authored by Moul's avatar Moul
Browse files

Introduce Ruff (#458)

pre-commit and gitlab-ci configurations
Add ruff configuration
parent bc6f7f46
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,14 @@ pre-commit:hooks: ...@@ -80,6 +80,14 @@ pre-commit:hooks:
- pre-commit run -a insert-license - pre-commit run -a insert-license
- pre-commit run -a mdformat - pre-commit run -a mdformat
ruff:
extends:
- .code_changes
- .pre-commit
stage: checks
script:
- pre-commit run -a ruff
.tests: .tests:
extends: .changes extends: .changes
stage: tests stage: tests
......
...@@ -10,6 +10,11 @@ repos: ...@@ -10,6 +10,11 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: mixed-line-ending - id: mixed-line-ending
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.254
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.1.0 rev: 23.1.0
hooks: hooks:
......
...@@ -43,3 +43,10 @@ classifiers = [ ...@@ -43,3 +43,10 @@ classifiers = [
[tool.mypy] [tool.mypy]
ignore_missing_imports = true ignore_missing_imports = true
[tool.ruff]
line-length = 101
target-version = "py37"
select = ["W", "I", "UP", "YTT", "B", "A", "DTZ", "T10",
"EXE", "ISC", "ICN", "G", "INP", "PIE", "PYI", "Q", "RSE", "SLF", "TID",
"COM", "C4", "PT", "RET", "SIM", "PTH", "PGH", "PL", "TRY", "RUF"]
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