Upgrade pyright, improve pyright config files (#8072)

This commit is contained in:
Alex Waygood
2022-06-16 18:50:50 +01:00
committed by GitHub
parent a2ef47660a
commit 6b0c8df9ec
12 changed files with 59 additions and 29 deletions

View File

@@ -12,6 +12,7 @@
"strictListInference": true,
"strictDictionaryInference": true,
"strictParameterNoneValue": true,
"strictSetInference": true,
"reportFunctionMemberAccess": "error",
"reportMissingModuleSource": "none",
"reportMissingTypeStubs": "error",
@@ -40,16 +41,18 @@
"reportUnboundVariable": "error",
"reportInvalidStubStatement": "error",
"reportInvalidTypeVarUse": "error",
"reportPropertyTypeMismatch": "none",
"reportSelfClsParameterName": "error",
"reportUnsupportedDunderAll": "error",
// Incompatible overrides are out of typeshed's control as they are
// inherited from the implementation.
"reportInconsistentConstructor": "error",
"reportTypeCommentUsage": "error",
"reportUnnecessaryComparison": "error",
// Incompatible overrides and property type mismatches are out of typeshed's control
// as they are inherited from the implementation.
"reportPropertyTypeMismatch": "none",
"reportIncompatibleMethodOverride": "none",
"reportIncompatibleVariableOverride": "none",
// Overlapping overloads cannot be enabled at this time because
// of the "fractions.Fraction.__pow__" method and "tasks.gather" function.
// Mypy's overlapping overload logic misses these issues (see mypy
// issue #10143 and #10157).
// Overlapping overloads are often necessary in a stub, meaning pyright's check
// (which is stricter than mypy's; see mypy issue #10143 and #10157)
// would cause many false positives and catch few bugs.
"reportOverlappingOverload": "none",
}