replace black & isort by ruff

This commit is contained in:
Guilhem Saurel 2024-02-20 10:47:57 +01:00
parent 2005945a2a
commit 1243a0fac2
3 changed files with 7 additions and 16 deletions

View File

@ -11,7 +11,7 @@ jobs:
python-version: '3.10'
cache: poetry
- run: poetry install --with dev --no-interaction
- run: poetry run black .
- run: poetry run ruff .
- run: poetry run ruff format .
- run: poetry run ruff check .
- run: poetry run safety check
- run: poetry run poetry check

View File

@ -1,15 +1,12 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281
rev: v0.2.2
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- id: ruff-format
- repo: https://github.com/nim65s/pre-commit-sort
rev: v0.1.0
hooks:
@ -20,7 +17,7 @@ repos:
- id: toml-sort-fix
exclude: poetry.lock
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
@ -37,7 +34,3 @@ repos:
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black

View File

@ -24,11 +24,9 @@ python = "^3.8"
optional = true
[tool.poetry.group.dev.dependencies]
black = "^23.1.0"
coverage = ">=6.4.4,<8.0.0"
httpx = ">=0.23,<0.25"
isort = "^5.12.0"
ruff = ">=0.0.254,<0.0.282"
ruff = "^0.2"
safety = {allow-prereleases = true, version = "^2.4.0b1"}
[tool.poetry.scripts]
@ -39,7 +37,7 @@ matrix-webhook = "matrix_webhook.__main__:main"
[tool.ruff]
extend-ignore = ["D203", "D213"]
extend-select = ["A", "B", "COM", "D", "EM", "EXE", "G", "N", "PTH", "RET", "RUF", "UP", "W", "YTT"]
extend-select = ["A", "B", "COM", "D", "EM", "EXE", "G", "I", "N", "PTH", "RET", "RUF", "UP", "W", "YTT"]
target-version = "py38"
[tool.tomlsort]