mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-20 08:38:26 +08:00
Further improve and simplify pyright configuration (#9714)
This commit is contained in:
@@ -6,13 +6,26 @@
|
||||
"stubs/**/@tests/test_cases"
|
||||
],
|
||||
"typeCheckingMode": "strict",
|
||||
// Using unspecific "type ignore" comments in test_cases.
|
||||
// Extra strict settings
|
||||
"reportShadowedImports": "error", // Don't accidentally name a file something that shadows stdlib
|
||||
"reportImplicitStringConcatenation": "error",
|
||||
"reportUninitializedInstanceVariable": "error",
|
||||
"reportUnnecessaryTypeIgnoreComment": "error",
|
||||
// Using unspecific `type: ignore` comments in test_cases.
|
||||
// See https://github.com/python/typeshed/pull/8083
|
||||
"enableTypeIgnoreComments": true,
|
||||
"reportPropertyTypeMismatch": "error",
|
||||
"reportUnnecessaryTypeIgnoreComment": "error",
|
||||
"reportMissingModuleSource": "none",
|
||||
// If a test case uses this anti-pattern, there's likely a reason and annoying to `type: ignore`.
|
||||
// Let flake8-bugbear flag it (B006)
|
||||
"reportCallInDefaultInitializer": "none",
|
||||
// Too strict and not needed for type testing
|
||||
"reportMissingSuperCall": "none",
|
||||
// Stubs are allowed to use private variables. We may want to test those.
|
||||
"reportPrivateUsage": "none",
|
||||
// Stubs don't need the actual modules to be installed
|
||||
"reportMissingModuleSource": "none",
|
||||
// Incompatible property type mismatches may be out of typeshed's control
|
||||
// when they are inherited from the implementation.
|
||||
"reportPropertyTypeMismatch": "none",
|
||||
// isinstance checks are still needed when validating inputs outside of typeshed's control
|
||||
"reportUnnecessaryIsInstance": "none",
|
||||
// The name of the self/cls parameter is out of typeshed's control.
|
||||
|
||||
Reference in New Issue
Block a user