From 428f5d49e091ad849fd04dad8f31bb3bf3b60912 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 29 Jan 2024 18:50:13 -0300 Subject: [PATCH] Use ruff in place of black and reorder-python-imports Unfortunately black and reorder-python-imports are no longer compatible between each other: https://github.com/asottile/reorder-python-imports/issues/367 https://github.com/asottile/reorder-python-imports/issues/366 https://github.com/psf/black/issues/4175 Take this opportunity to try out ruff. --- .pre-commit-config.yaml | 14 ++++++-------- pyproject.toml | 3 +++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0cd053b4..cb1a9c0d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,6 @@ repos: rev: v2.2.6 hooks: - id: codespell -- repo: https://github.com/psf/black - rev: 23.11.0 - hooks: - - id: black - repo: https://github.com/asottile/blacken-docs rev: 1.16.0 hooks: @@ -23,11 +19,13 @@ repos: hooks: - id: pyupgrade args: [--py37-plus] -- repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.14 hooks: - - id: reorder-python-imports - args: ['--application-directories=execnet', --py37-plus] + - id: ruff + args: [ --fix ] + exclude: "^doc/" + - id: ruff-format - repo: https://github.com/PyCQA/doc8 rev: 'v1.1.1' hooks: diff --git a/pyproject.toml b/pyproject.toml index c010499f..75c5413b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,9 @@ testing = [ [project.urls] Homepage = "https://execnet.readthedocs.io/en/latest/" +[tool.ruff.lint] +ignore = ["E741"] + [tool.hatch.version] source = "vcs"