mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix flake8 and isort errors (refs: #9800)
This commit is contained in:
parent
3fa146078b
commit
558f54a2b4
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user