Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: modernize Ruff #894

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading