From 2999f610b40a4dd5ea6a52a02eeda8d926ae8d62 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Sat, 28 Oct 2023 13:08:08 +0200 Subject: [PATCH 1/2] chore: replace `black` with `ruff format` --- .pre-commit-config.yaml | 7 ++----- pyproject.toml | 8 +++----- renovate.json5 | 4 ---- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4428701b..84cbc025 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,8 +13,5 @@ repos: rev: "v0.1.3" hooks: - id: ruff - - - repo: https://github.com/psf/black-pre-commit-mirror - rev: "23.9.1" - hooks: - - id: black + args: [--exit-non-zero-on-fix] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index 6897dc5f..35540c31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,11 +47,6 @@ types-colorama = { version = "0.4.15.12", markers = "sys_platform == 'win32'" } requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" -[tool.black] -line-length = 120 -target-version = ["py38"] -preview = true - [tool.coverage.report] skip_empty = true # Subset of rules from https://pypi.org/project/covdefaults/ @@ -173,6 +168,9 @@ extend-exclude = ["tests/data/*"] [tool.ruff.flake8-type-checking] strict = true +[tool.ruff.format] +preview = true + [tool.ruff.isort] required-imports = ["from __future__ import annotations"] diff --git a/renovate.json5 b/renovate.json5 index 3e95be6a..03b26972 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -52,10 +52,6 @@ matchPackageNames: ["astral-sh/ruff-pre-commit"], customChangelogUrl: "https://github.com/charliermarsh/ruff", }, - { - matchPackageNames: ["psf/black-pre-commit-mirror"], - customChangelogUrl: "https://github.com/psf/black", - }, ], // https://docs.renovatebot.com/configuration-options/#regexmanagers From 4ed93357d591be13d594041b4c67c90ff51768e3 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Sat, 28 Oct 2023 13:08:37 +0200 Subject: [PATCH 2/2] chore: run `pre-commit run ruff-format -a` --- tests/unit/deprecate/test_ignore_flags.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/deprecate/test_ignore_flags.py b/tests/unit/deprecate/test_ignore_flags.py index 131d7242..312706d1 100644 --- a/tests/unit/deprecate/test_ignore_flags.py +++ b/tests/unit/deprecate/test_ignore_flags.py @@ -13,8 +13,7 @@ def test_generate_deprecation_warning() -> None: result = generate_deprecation_warning(flag_name="ignore-missing", issue_code="DEP002", sequence=("hi", "bye")) assert ( - result - == "Warning: In an upcoming release, support for the `--ignore-missing` command-line option and the" + result == "Warning: In an upcoming release, support for the `--ignore-missing` command-line option and the" " `ignore_missing` configuration parameter will be discontinued. Instead, use `--per-rule-ignores" ' DEP002=hi|bye` or add a line `DEP002 = ["hi", "bye"]` to the `[tool.deptry.per_rule_ignores]` section of the' " configuration file."