Skip to content

Commit fbf1008

Browse files
authored
bpo-42238: Fix small rst issue in NEWS.d/. (#27238)
1 parent d01dceb commit fbf1008

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Doc/tools/rstlint.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
":newsgroup:",
9191
":code:",
9292
":py:func:",
93-
":memory:",
9493
":makevar:",
9594
":guilabel:",
9695
":title-reference:",
@@ -123,6 +122,13 @@
123122
double_backtick_role = re.compile(r"(?<!``)%s``" % all_roles)
124123

125124

125+
# Find role used with no backticks instead of simple backticks like:
126+
# :const:None
127+
# instead of:
128+
# :const:`None`
129+
role_with_no_backticks = re.compile(r"%s[^` ]" % all_roles)
130+
131+
126132
default_role_re = re.compile(r"(^| )`\w([^`]*?\w)?`($| )")
127133
leaked_markup_re = re.compile(r"[a-z]::\s|`|\.\.\s*\w+:")
128134

@@ -168,6 +174,8 @@ def check_suspicious_constructs(fn, lines):
168174
yield lno, "directive should start with two dots, not three."
169175
if double_backtick_role.search(line):
170176
yield lno, "role use a single backtick, double backtick found."
177+
if role_with_no_backticks.search(line):
178+
yield lno, "role use a single backtick, no backtick found."
171179
if ".. productionlist::" in line:
172180
inprod = True
173181
elif not inprod and default_role_re.search(line):
Original file line numberDiff line numberDiff line change
@@ -1 +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.
1+
Refactor argument processing in :func:`pdb.main` to simplify detection of errors in input loading and clarify behavior around module or script invocation.

0 commit comments

Comments
 (0)