From 26a0cea8126301f48a33847ac3ef941c7156499f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 27 Oct 2023 23:41:15 +0200 Subject: [PATCH] Use ruff --- .pre-commit-config.yaml | 39 +++++++-------------------------------- pyproject.toml | 9 +++++++-- 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e30060a..0d6b570 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,42 +1,17 @@ default_language_version: python: python3 repos: - - repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - - repo: https://github.com/PyCQA/autoflake - rev: v2.0.1 - hooks: - - id: autoflake - args: - - --in-place - - --ignore-init-module-imports - - --remove-all-unused-imports - - --remove-duplicate-keys - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-toml - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/PyCQA/flake8 - rev: "6.0.0" - hooks: - - id: flake8 - additional_dependencies: ["flake8-bugbear==22.8.23"] - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - - repo: https://github.com/PyCQA/docformatter - rev: v1.5.1 - hooks: - - id: docformatter - args: ["--in-place", "--wrap-summaries=88"] - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.1.3 hooks: - - id: pyupgrade - args: ["--py36-plus"] + - id: ruff + args: [ --fix, --exit-non-zero-on-fix ] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index 1f4ff15..712a4ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,5 +77,10 @@ exclude_lines = [ "if TYPE_CHECKING:", ] -[tool.isort] -profile = "black" +# ruff + +[tool.ruff.lint] +extend-select = [ + "UP", # pyupgrade + "I", # isort +]