Skip to content

Commit

Permalink
Enable more ruff lints
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyNotHugo committed Aug 16, 2023
1 parent 35cdafb commit 7b23efd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: check-added-large-files
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.270
rev: v0.0.284
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# noqa: INP001
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
Expand Down
37 changes: 35 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
[tool.ruff]
select = [
"E",
"F",
"E",
"W",
"B",
"I",
# "N", # TODO: fixing these would break public API
"UP",
"YTT",
# "ANN",
# "BLE",
# "FBT",
"B",
# "A", # Conflicts with some django patterns
"C4",
"ISC",
"ICN",
"G",
"INP",
"PIE",
"PYI",
# "PT", # TODO: some tests are not pytest
"Q",
"RSE",
"RET",
# "SIM", # TODO
"TID",
"TCH",
"INT",
"ERA",
"PGH",
"PLE",
"RUF",
]
target-version = "py38"
ignore = [
"RUF012", # FIXME
]

[tool.ruff.isort]
force-single-line = true

[tool.ruff.per-file-ignores]
# Fails with auto-generated migrations. Unsolvable contradiction between ruff and mypy.
# This likely needs to be addressed in Django itself (either use an immutable
# type or annotate these fields as ClassVar)
"testapp/testapp/testmain/migrations/0*.py"= ["RUF012"]

0 comments on commit 7b23efd

Please sign in to comment.