Fix flake8 and isort errors (refs: #9800)

This commit is contained in:
Takeshi KOMIYA 2021-11-29 09:42:20 +09:00
parent 3fa146078b
commit 558f54a2b4

View File

@ -25,8 +25,8 @@
:license: BSD, see LICENSE for details.
"""
import warnings
import re
import warnings
from typing import Any, Dict, List, Tuple
from docutils import nodes, utils
@ -73,13 +73,10 @@ class ExternalLinksChecker(SphinxPostTransform):
match = uri_pattern.match(uri)
if match and match.groupdict().get('value'):
# build a replacement suggestion
msg = __('hardcoded link %r could be replaced by an extlink '
'(try using %r instead)')
replacement = f":{alias}:`{match.groupdict().get('value')}`"
logger.warning(
__('hardcoded link %r could be replaced by an extlink (try using %r instead)'),
uri,
replacement,
location=refnode,
)
logger.warning(msg, uri, replacement, location=refnode)
def make_link_role(name: str, base_url: str, caption: str) -> RoleFunction: