4040 _log = get_plugin_logger (__name__ )
4141except ImportError :
4242 # TODO: remove once support for MkDocs <1.5 is dropped
43- _log = logging .getLogger (f"mkdocs.plugins.{ __name__ } " ) # type: ignore[assignment]
43+ _log = logging .getLogger (f"mkdocs.plugins.{ __name__ } " )
4444
4545
4646AUTOREF_RE = re .compile (r"<autoref (?P<attrs>.*?)>(?P<title>.*?)</autoref>" , flags = re .DOTALL )
@@ -115,7 +115,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
115115
116116 # Code based on
117117 # https://github.com/Python-Markdown/markdown/blob/8e7528fa5c98bf4652deb13206d6e6241d61630b/markdown/inlinepatterns.py#L780
118- def handleMatch (self , m : Match [str ], data : str ) -> tuple [Element | None , int | None , int | None ]: # type: ignore[override] # noqa: N802
118+ def handleMatch (self , m : Match [str ], data : str ) -> tuple [Element | None , int | None , int | None ]: # noqa: N802
119119 """Handle an element that matched.
120120
121121 Arguments:
@@ -141,7 +141,7 @@ def handleMatch(self, m: Match[str], data: str) -> tuple[Element | None, int | N
141141 return self ._make_tag (identifier , text , slug = slug ), m .start (0 ), end
142142
143143 def _unstash (self , identifier : str ) -> str :
144- stashed_nodes : dict [str , Element | str ] = self .md .treeprocessors ["inline" ].stashed_nodes # type: ignore[attr-defined]
144+ stashed_nodes : dict [str , Element | str ] = self .md .treeprocessors ["inline" ].stashed_nodes
145145
146146 def _repl (match : Match ) -> str :
147147 el = stashed_nodes .get (match [1 ])
@@ -179,7 +179,7 @@ def _eval_id(self, data: str, index: int, text: str) -> tuple[str | None, str |
179179
180180 # Catch single stash entries, like the result of [`Foo`][].
181181 if match := INLINE_PLACEHOLDER_RE .fullmatch (identifier ):
182- stashed_nodes : dict [str , Element | str ] = self .md .treeprocessors ["inline" ].stashed_nodes # type: ignore[attr-defined]
182+ stashed_nodes : dict [str , Element | str ] = self .md .treeprocessors ["inline" ].stashed_nodes
183183 el = stashed_nodes .get (match [1 ])
184184 if isinstance (el , Element ) and el .tag == "code" :
185185 # The title was wrapped in backticks, we only keep the content,
@@ -626,7 +626,7 @@ def _find_url(
626626 for identifier in identifiers :
627627 try :
628628 return url_mapper (identifier )
629- except KeyError :
629+ except KeyError : # noqa: PERF203
630630 pass
631631 raise KeyError (f"None of the identifiers { identifiers } were found" )
632632
0 commit comments