Skip to content

Commit

Permalink
STY: Enforce ruff rules
Browse files Browse the repository at this point in the history
Disable some rules and postpone fixes.
  • Loading branch information
DimitriPapadopoulos committed Oct 9, 2024
1 parent 1253ce5 commit 9aa4484
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ repos:
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: ["--fix", "--show-source"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,86 @@ build-backend = "setuptools.build_meta"

[tool.black]
skip-string-normalization = true

[tool.ruff]
line-length = 88 # same as black

[tool.ruff.lint]
extend-select = [
"B",
"C4",
"FLY",
"FURB",
"PERF",
"PGH",
"PIE",
"PLE",
"PT",
"PYI",
"Q",
"RSE",
"RUF",
"UP",
]
ignore = [
"B006", # requires annotations
"B011",
"B017", # TODO: enable rule
"B020", # TODO: enable rule
"B028",
"B904",
"C401",
"C408",
"C420", # TODO: enable rule
"E402",
"E722",
"E731", # TODO: enable rule
"F401",
"F403",
"F811",
"F841",
"FURB101",
"FURB103",
"FURB113",
"FURB118", # TODO: enable rule
"FURB140", # TODO: enable rule
"FURB171", # TODO: enable rule
"PGH003", # TODO: enable rule
"PGH004", # TODO: enable rule
"PERF203",
"PIE790",
"PIE794",
"PT001",
"PT004", # deprecated
"PT005", # deprecated
"PT011",
"PT015", # TODO: enable rule
"PT017", # TODO: enable rule
"PT018",
"PT019", # TODO: enable rule
"PT021", # TODO: enable rule
"PYI024",
"RUF002",
"RUF005",
"RUF012", # requires annotations
"RUF015",
"UP027", # deprecated
"UP031", # TODO: enable rule
"UP032", # TODO: enable rule
"UP038", # https://github.com/astral-sh/ruff/issues/7871
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
]

0 comments on commit 9aa4484

Please sign in to comment.