mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
mypy: Enable new error explicit-override.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
d257002ad8
commit
a50eb2e809
@@ -6,6 +6,7 @@ from xml.etree.ElementTree import Element
|
||||
from markdown import Extension, Markdown
|
||||
from markdown.blockparser import BlockParser
|
||||
from markdown.blockprocessors import BlockProcessor
|
||||
from typing_extensions import override
|
||||
|
||||
from zerver.lib.exceptions import InvalidMarkdownIncludeStatementError
|
||||
from zerver.lib.markdown.priorities import BLOCK_PROCESSOR_PRIORITIES
|
||||
@@ -16,6 +17,7 @@ class IncludeExtension(Extension):
|
||||
super().__init__()
|
||||
self.base_path = base_path
|
||||
|
||||
@override
|
||||
def extendMarkdown(self, md: Markdown) -> None:
|
||||
md.parser.blockprocessors.register(
|
||||
IncludeBlockProcessor(md.parser, self.base_path),
|
||||
@@ -31,6 +33,7 @@ class IncludeBlockProcessor(BlockProcessor):
|
||||
super().__init__(parser)
|
||||
self.base_path = base_path
|
||||
|
||||
@override
|
||||
def test(self, parent: Element, block: str) -> bool:
|
||||
return bool(self.RE.search(block))
|
||||
|
||||
@@ -46,6 +49,7 @@ class IncludeBlockProcessor(BlockProcessor):
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
@override
|
||||
def run(self, parent: Element, blocks: List[str]) -> None:
|
||||
self.parser.state.set("include")
|
||||
self.parser.parseChunk(parent, self.RE.sub(self.expand_include, blocks.pop(0)))
|
||||
|
||||
Reference in New Issue
Block a user