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' python-version: '3.10'
cache: poetry cache: poetry
- run: poetry install --with dev --no-interaction - run: poetry install --with dev --no-interaction
- run: poetry run black . - run: poetry run ruff format .
- run: poetry run ruff . - run: poetry run ruff check .
- run: poetry run safety check - run: poetry run safety check
- run: poetry run poetry check - run: poetry run poetry check

View File

@@ -1,15 +1,12 @@
repos: repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281 rev: v0.2.2
hooks: hooks:
- id: ruff - id: ruff
args: args:
- --fix - --fix
- --exit-non-zero-on-fix - --exit-non-zero-on-fix
- id: ruff-format
- repo: https://github.com/nim65s/pre-commit-sort - repo: https://github.com/nim65s/pre-commit-sort
rev: v0.1.0 rev: v0.1.0
hooks: hooks:
@@ -20,7 +17,7 @@ repos:
- id: toml-sort-fix - id: toml-sort-fix
exclude: poetry.lock exclude: poetry.lock
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 rev: v4.5.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-ast - id: check-ast
@@ -37,7 +34,3 @@ repos:
- id: fix-byte-order-marker - id: fix-byte-order-marker
- id: mixed-line-ending - id: mixed-line-ending
- id: trailing-whitespace - 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 optional = true
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
black = "^23.1.0"
coverage = ">=6.4.4,<8.0.0" coverage = ">=6.4.4,<8.0.0"
httpx = ">=0.23,<0.25" httpx = ">=0.23,<0.25"
isort = "^5.12.0" ruff = "^0.2"
ruff = ">=0.0.254,<0.0.282"
safety = {allow-prereleases = true, version = "^2.4.0b1"} safety = {allow-prereleases = true, version = "^2.4.0b1"}
[tool.poetry.scripts] [tool.poetry.scripts]
@@ -39,7 +37,7 @@ matrix-webhook = "matrix_webhook.__main__:main"
[tool.ruff] [tool.ruff]
extend-ignore = ["D203", "D213"] 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" target-version = "py38"
[tool.tomlsort] [tool.tomlsort]