Skip to content

Commit

Permalink
Fix flake8 and isort errors (refs: sphinx-doc#9800)
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Nov 29, 2021
1 parent 3fa1460 commit 558f54a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sphinx/ext/extlinks.py
Expand Up @@ -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
Expand Down Expand Up @@ -73,13 +73,10 @@ def check_uri(self, refnode: nodes.reference) -> None:
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:
Expand Down

0 comments on commit 558f54a

Please sign in to comment.