From 1243a0fac2dedc53ff9aa6fa580616328f574479 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 20 Feb 2024 10:47:57 +0100 Subject: [PATCH] replace black & isort by ruff --- .github/workflows/lint.yml | 4 ++-- .pre-commit-config.yaml | 13 +++---------- pyproject.toml | 6 ++---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9625393..d96b8c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08bf229..c601187 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index fe9ce90..e4e4def 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]