typeshed
typeshed copied to clipboard
[docutils] Add missing stubs for `transforms` dir
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:96: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:283:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: In member "visit_image" of class "SphinxContentsFilter":
+ sphinx/transforms/__init__.py:355:5: error: Return type "None" of "visit_image" incompatible with return type "Never" in supertype "ContentsFilter" [override]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "SphinxSmartQuotes":
+ sphinx/transforms/__init__.py:372:9: error: Cannot assign to class variable "smartquotes_action" via instance [misc]
+ sphinx/transforms/__init__.py: note: At top level:
- sphinx/transforms/__init__.py:397:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[str, str], None, None]" in supertype "SmartQuotes" [override]
+ sphinx/transforms/__init__.py:397:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[Literal['literal', 'plain'], str], None, None]" in supertype "SmartQuotes" [override]
+ sphinx/transforms/__init__.py:397:26: error: Argument 1 of "get_tokens" is incompatible with supertype "SmartQuotes"; supertype defines the argument type as "Iterable[Node]" [override]
+ sphinx/transforms/__init__.py:397:26: note: This violates the Liskov substitution principle
+ sphinx/transforms/__init__.py:397:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ sphinx/builders/latex/transforms.py:531: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:143:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:216:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:217:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:95: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:284:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: In member "visit_image" of class "SphinxContentsFilter":
+ sphinx/transforms/__init__.py:356:5: error: Return type "None" of "visit_image" incompatible with return type "Never" in supertype "ContentsFilter" [override]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "SphinxSmartQuotes":
+ sphinx/transforms/__init__.py:373:9: error: Cannot assign to class variable "smartquotes_action" via instance [misc]
+ sphinx/transforms/__init__.py: note: At top level:
- sphinx/transforms/__init__.py:398:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[str, str], None, None]" in supertype "SmartQuotes" [override]
+ sphinx/transforms/__init__.py:398:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[Literal['literal', 'plain'], str], None, None]" in supertype "SmartQuotes" [override]
+ sphinx/transforms/__init__.py:398:26: error: Argument 1 of "get_tokens" is incompatible with supertype "SmartQuotes"; supertype defines the argument type as "Iterable[Node]" [override]
+ sphinx/transforms/__init__.py:398:26: note: This violates the Liskov substitution principle
+ sphinx/transforms/__init__.py:398:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ sphinx/builders/latex/transforms.py:531: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:112:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:216:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:217:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:95: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:284:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "SphinxSmartQuotes":
+ sphinx/transforms/__init__.py:373:9: error: Cannot assign to class variable "smartquotes_action" via instance [misc]
+ sphinx/transforms/__init__.py: note: At top level:
- sphinx/transforms/__init__.py:398:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[str, str], None, None]" in supertype "SmartQuotes" [override]
+ sphinx/transforms/__init__.py:398:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[Literal['literal', 'plain'], str], None, None]" in supertype "SmartQuotes" [override]
+ sphinx/transforms/__init__.py:398:26: error: Argument 1 of "get_tokens" is incompatible with supertype "SmartQuotes"; supertype defines the argument type as "Iterable[Node]" [override]
+ sphinx/transforms/__init__.py:398:26: note: This violates the Liskov substitution principle
+ sphinx/transforms/__init__.py:398:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ sphinx/builders/latex/transforms.py:531: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:112:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:216:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:217:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]