summaryrefslogtreecommitdiff
path: root/sphinx/ext/extlinks.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-11-29 09:42:20 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-11-29 09:42:20 +0900
commit558f54a2b45ca77b7c942e17128d8bd6d45dd33c (patch)
tree5e99f5adb379ebb855e2dcf2e14f0160354260e7 /sphinx/ext/extlinks.py
parent3fa146078bafbf82a38d4f95ea1ae4eee4f86827 (diff)
downloadsphinx-git-558f54a2b45ca77b7c942e17128d8bd6d45dd33c.tar.gz
Fix flake8 and isort errors (refs: #9800)
Diffstat (limited to 'sphinx/ext/extlinks.py')
-rw-r--r--sphinx/ext/extlinks.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py
index 59c5d9309..5709a12f5 100644
--- a/sphinx/ext/extlinks.py
+++ b/sphinx/ext/extlinks.py
@@ -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: