From 5a1490154bb2cfa2ef404cbfe0509955d3056c8d Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 25 Oct 2023 22:23:55 -0400 Subject: [PATCH] chore: modernize Ruff Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9a6be9bd..3fbf4d74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.10.0 + rev: 23.10.1 hooks: - id: black-jupyter @@ -52,7 +52,7 @@ repos: ] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.1" + rev: "v0.1.2" hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/pyproject.toml b/pyproject.toml index fefad6ee..34bc9ed1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,8 +122,11 @@ messages_control.disable = [ ] [tool.ruff] -select = [ - "E", "F", "W", # flake8 +target-version = "py37" +src = ["src"] + +[tool.ruff.lint] +extend-select = [ "B", # flake8-bugbear "I", # isort "ARG", # flake8-unused-arguments @@ -142,13 +145,11 @@ select = [ "UP", # pyupgrade "YTT", # flake8-2020 ] -extend-ignore = [ +ignore = [ "PLR", # Design related pylint codes "E501", # Line too long "PT011", "PT013" ] -target-version = "py37" -src = ["src"] unfixable = [ "T20", # Removes print statements "F841", # Removes unused variables @@ -159,10 +160,10 @@ flake8-unused-arguments.ignore-variadic-names = true isort.required-imports = ["from __future__ import annotations"] -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 13 -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "docs/*" = ["T20"] "examples/*" = ["T20"] "scripts/*" = ["T20"]