Check for unused pyright: ignore and differentiate from mypy ignores (#9397)

This commit is contained in:
Avasam authored and GitHub committed 2022-12-28 10:44:29 +00:00
1 parent 07f587dc70
commit 23ac9bff19
17 files changed
+44 -21

No files matched your search

+5
View File
@@ -467,6 +467,11 @@ Some further tips for good type hints:
platform-dependent APIs;
* use mypy error codes for mypy-specific `# type: ignore` annotations,
e.g. `# type: ignore[override]` for Liskov Substitution Principle violations.
* use pyright error codes for pyright-specific suppressions,
e.g. `# pyright: ignore[reportGeneralTypeIssues]`.
- pyright is configured to discard `# type: ignore` annotations.
If you need both on the same line, mypy's annotation needs to go first,
e.g. `# type: ignore[override] # pyright: ignore[reportGeneralTypeIssues]`.
Imports in stubs are considered private (not part of the exported API)
unless: