Skip to content

Commit

Permalink
🔧 Go all in with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed Dec 6, 2024
1 parent 46d1cb6 commit ecada01
Showing 1 changed file with 21 additions and 63 deletions.
84 changes: 21 additions & 63 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ target-version = [

[tool.mypy]
check_untyped_defs = true
disallow_any_decorated = true
disallow_any_explicit = true
disallow_any_expr = true
disallow_any_generics = true
disallow_any_unimported = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
Expand All @@ -78,13 +82,18 @@ disallow_untyped_defs = true
extra_checks = true
ignore_missing_imports = true
no_implicit_reexport = true
show_column_numbers = true
show_error_codes = true
strict_equality = true
warn_return_any = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
warn_unreachable = true
warn_unused_configs = true

[[tool.mypy.overrides]]
module = "tests.*"
disallow_any_decorated = false # mock.MagicMock is Any

[tool.ruff]
src = [
Expand All @@ -94,73 +103,22 @@ target-version = "py39"

[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"ASYNC",
"B",
"BLE",
"C4",
"COM",
"DTZ",
"E",
"EM",
"ERA",
"EXE",
"F",
"FA",
"FBT",
"FIX",
"FLY",
"FURB",
"G",
"I",
"ICN",
"INP",
"ISC",
"LOG",
"N",
"PGH",
"PERF",
"PIE",
"PL",
"PT",
"PTH",
"PYI",
"Q",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"SLOT",
"T10",
"TCH",
"TD",
"TID",
"TRY",
"UP",
"W",
"YTT",
"ALL",
]
ignore = [
"ANN401",
"COM812",
"E501",
"FIX002",
"PLR09",
"TD002",
"TD003",
"TRY003",
"COM812", # Avoid magic trailing commas
"D10", # Not everything needs a docstring
"D203", # Prefer `no-blank-line-before-class` (D211)
"D213", # Prefer `multi-line-summary-first-line` (D212)
"E501", # Avoid clashes with black
"PLR09", # Adding a limit to complexity is too arbitrary
]

[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"FBT001",
"PLR2004",
"PT011",
"S101",
"FBT001", # Test arguments are handled by pytest
"PLR2004", # Tests should contain magic number comparisons
"S101", # Pytest needs assert statements
]
"dev_scripts/**" = [
"INP001",
Expand Down

0 comments on commit ecada01

Please sign in to comment.