summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Palard <julien@palard.fr>2021-07-19 14:34:48 (GMT)
committerGitHub <noreply@github.com>2021-07-19 14:34:48 (GMT)
commitfbf10080bb369cfef1f230c2cd5135a558b242d5 (patch)
tree419a4ca1466851b6d616bea0b4987216384b3730
parentd01dceb88b2ca6def8a2284e4c90f89a4a27823f (diff)
downloadcpython-fbf10080bb369cfef1f230c2cd5135a558b242d5.zip
cpython-fbf10080bb369cfef1f230c2cd5135a558b242d5.tar.gz
cpython-fbf10080bb369cfef1f230c2cd5135a558b242d5.tar.bz2
bpo-42238: Fix small rst issue in NEWS.d/. (#27238)
-rwxr-xr-xDoc/tools/rstlint.py10
-rw-r--r--Misc/NEWS.d/next/Library/2021-07-02-18-17-56.bpo-44554.aBUmJo.rst2
2 files changed, 10 insertions, 2 deletions
diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py
index c9bff80..91aed80 100755
--- a/Doc/tools/rstlint.py
+++ b/Doc/tools/rstlint.py
@@ -90,7 +90,6 @@ roles = [
":newsgroup:",
":code:",
":py:func:",
- ":memory:",
":makevar:",
":guilabel:",
":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)
+# 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)?`($| )")
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."
if double_backtick_role.search(line):
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:
inprod = True
elif not inprod and default_role_re.search(line):
diff --git a/Misc/NEWS.d/next/Library/2021-07-02-18-17-56.bpo-44554.aBUmJo.rst b/Misc/NEWS.d/next/Library/2021-07-02-18-17-56.bpo-44554.aBUmJo.rst
index 6ca8cdc..2c225b8 100644
--- a/Misc/NEWS.d/next/Library/2021-07-02-18-17-56.bpo-44554.aBUmJo.rst
+++ b/Misc/NEWS.d/next/Library/2021-07-02-18-17-56.bpo-44554.aBUmJo.rst
@@ -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.