Skip to content

Commit

Permalink
chore: modernize Ruff config (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored Nov 1, 2023
1 parent 6818305 commit 37dd59e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37dd59e

Please sign in to comment.