From 37dd59eaf138006b8626f44b70ac3e7bc9ee90b3 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 31 Oct 2023 20:03:51 -0400 Subject: [PATCH] chore: modernize Ruff config (#148) --- .pre-commit-config.yaml | 7 ++----- pyproject.toml | 10 +++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f3ea81..65033c9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,10 +4,6 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 - hooks: - - id: ruff-format - repo: https://github.com/codespell-project/codespell rev: v2.2.6 hooks: @@ -39,7 +35,8 @@ repos: rev: v0.1.3 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes] + args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes, --show-fixes] + - id: ruff-format - repo: meta hooks: - id: check-hooks-apply diff --git a/pyproject.toml b/pyproject.toml index 8af3212..d218a2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,18 +61,18 @@ build.targets.sdist.include = ["/src", "/tests","tox.ini"] version.source = "vcs" [tool.ruff] -select = ["ALL"] line-length = 120 -target-version = "py38" -isort = {known-first-party = ["pyproject_fmt"], required-imports = ["from __future__ import annotations"]} -ignore = [ +src = ["src", ""] +lint.select = ["ALL"] +lint.isort.required-imports = ["from __future__ import annotations"] +lint.ignore = [ "ANN101", # no type annotation for self "ANN401", # allow Any as type annotation "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible "S104", # Possible binding to all interface ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/**/*.py" = [ "S101", # asserts allowed in tests... "FBT", # don"t care about booleans as positional arguments in tests