ci/lint: per-file ignores for tests in ruff and basedpyright

Relax ANN/ARG/PLR/C901 and related rules under tests/**; silence noisy
basedpyright reports for test fakes and private helpers.
This commit is contained in:
2026-07-15 10:35:30 +08:00
parent c5745e0711
commit 5c13e06427
10 changed files with 58 additions and 25 deletions
+33
View File
@@ -42,6 +42,23 @@ reportExplicitAny = "hint"
reportImplicitStringConcatenation = "hint"
reportImportCycles = "hint"
[[tool.basedpyright.executionEnvironments]]
root = "tests"
extraPaths = ["src", "."]
reportPrivateUsage = "none"
reportUnreachable = "none"
reportUnusedCallResult = "none"
reportUnannotatedClassAttribute = "none"
reportUnknownArgumentType = "none"
reportUnknownLambdaType = "none"
reportUnknownMemberType = "none"
reportUnknownVariableType = "none"
reportUnknownParameterType = "none"
reportMissingParameterType = "none"
reportUnusedParameter = "none"
reportMissingImports = "none"
reportMissingTypeStubs = "none"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
@@ -129,3 +146,19 @@ allowed-confusables = [
"",
"、"
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ANN", # type annotations often noisy in tests
"ARG", # unused fixtures/args are common
"ASYNC240", # pathlib in async tests is fine
"PLR2004", # magic values in asserts
"PLR0911", # many returns in fixtures/helpers
"PLR0912", # branching in scripted clients
"PLR0915", # long test functions
"C901", # complexity in scripted fakes
"S101", # assert is the point of tests
"TC", # TYPE_CHECKING import churn
"TRY003", # long exception messages in tests
"FBT", # boolean positional args in helpers
]