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