Skip to content

Commit

Permalink
chore: modernize Ruff (#894)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Oct 26, 2023
1 parent 9537e0a commit 68be137
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"]
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"]
Expand Down

0 comments on commit 68be137

Please sign in to comment.