mirror of https://github.com/python/cpython
bpo-42238: Fix small rst issue in NEWS.d/. (#27238)
This commit is contained in:
parent
d01dceb88b
commit
fbf10080bb
|
@ -90,7 +90,6 @@ roles = [
|
||||||
":newsgroup:",
|
":newsgroup:",
|
||||||
":code:",
|
":code:",
|
||||||
":py:func:",
|
":py:func:",
|
||||||
":memory:",
|
|
||||||
":makevar:",
|
":makevar:",
|
||||||
":guilabel:",
|
":guilabel:",
|
||||||
":title-reference:",
|
":title-reference:",
|
||||||
|
@ -123,6 +122,13 @@ three_dot_directive_re = re.compile(r"\.\.\. %s::" % all_directives)
|
||||||
double_backtick_role = re.compile(r"(?<!``)%s``" % all_roles)
|
double_backtick_role = re.compile(r"(?<!``)%s``" % all_roles)
|
||||||
|
|
||||||
|
|
||||||
|
# Find role used with no backticks instead of simple backticks like:
|
||||||
|
# :const:None
|
||||||
|
# instead of:
|
||||||
|
# :const:`None`
|
||||||
|
role_with_no_backticks = re.compile(r"%s[^` ]" % all_roles)
|
||||||
|
|
||||||
|
|
||||||
default_role_re = re.compile(r"(^| )`\w([^`]*?\w)?`($| )")
|
default_role_re = re.compile(r"(^| )`\w([^`]*?\w)?`($| )")
|
||||||
leaked_markup_re = re.compile(r"[a-z]::\s|`|\.\.\s*\w+:")
|
leaked_markup_re = re.compile(r"[a-z]::\s|`|\.\.\s*\w+:")
|
||||||
|
|
||||||
|
@ -168,6 +174,8 @@ def check_suspicious_constructs(fn, lines):
|
||||||
yield lno, "directive should start with two dots, not three."
|
yield lno, "directive should start with two dots, not three."
|
||||||
if double_backtick_role.search(line):
|
if double_backtick_role.search(line):
|
||||||
yield lno, "role use a single backtick, double backtick found."
|
yield lno, "role use a single backtick, double backtick found."
|
||||||
|
if role_with_no_backticks.search(line):
|
||||||
|
yield lno, "role use a single backtick, no backtick found."
|
||||||
if ".. productionlist::" in line:
|
if ".. productionlist::" in line:
|
||||||
inprod = True
|
inprod = True
|
||||||
elif not inprod and default_role_re.search(line):
|
elif not inprod and default_role_re.search(line):
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Refactor argument processing in :func:pdb.main to simplify detection of errors in input loading and clarify behavior around module or script invocation.
|
Refactor argument processing in :func:`pdb.main` to simplify detection of errors in input loading and clarify behavior around module or script invocation.
|
||||||
|
|
Loading…
Reference in New Issue