]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42238: Fix small rst issue in NEWS.d/. (#27238)
authorJulien Palard <julien@palard.fr>
Mon, 19 Jul 2021 14:34:48 +0000 (16:34 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 14:34:48 +0000 (16:34 +0200)
Doc/tools/rstlint.py
Misc/NEWS.d/next/Library/2021-07-02-18-17-56.bpo-44554.aBUmJo.rst

index c9bff80995bfd3217c958c2ea9d8b44104364df9..91aed80b1e9a6cdadf4378ce809419f2c466148d 100755 (executable)
@@ -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):
index 6ca8cdc22fa6e87305ec7c7af381d18e99402b44..2c225b8083951638bf4407ca7527aa16e3f23844 100644 (file)
@@ -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.