Skip to content

Commit

Permalink
🔧 Make linting stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed Dec 8, 2024
1 parent 46d1cb6 commit f1475dc
Showing 1 changed file with 23 additions and 63 deletions.
86 changes: 23 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 = false # (strict mode): Remove all Any types
disallow_any_expr = false # many builtins are Any
disallow_any_generics = true
disallow_any_unimported = false # (strict mode): Remove all Any types
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,24 @@ 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",
"ANN401", # (strict mode): Remove all Any types
"C901", # Adding a limit to complexity is too arbitrary
"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 f1475dc

Please sign in to comment.