File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -1177,15 +1177,15 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
11771177
11781178 Suspend tracing and profiling in the Python thread state *tstate *.
11791179
1180- Resume them using the:c: func:`PyThreadState_LeaveTracing ` function.
1180+ Resume them using the :c:func: `PyThreadState_LeaveTracing ` function.
11811181
11821182 .. versionadded :: 3.11
11831183
11841184
11851185.. c :function :: void PyThreadState_LeaveTracing (PyThreadState *tstate)
11861186
11871187 Resume tracing and profiling in the Python thread state *tstate * suspended
1188- by the:c: func:`PyThreadState_EnterTracing ` function.
1188+ by the :c:func: `PyThreadState_EnterTracing ` function.
11891189
11901190 See also :c:func: `PyEval_SetTrace ` and :c:func: `PyEval_SetProfile `
11911191 functions.
Original file line number Diff line number Diff line change 4343]
4444
4545roles = [
46- ":class:" ,
47- ":func:" ,
48- ":meth:" ,
49- ":mod:" ,
46+ "(?<!py) :class:" ,
47+ "(?<!:c|py) :func:" ,
48+ "(?<!py) :meth:" ,
49+ "(?<!:py) :mod:" ,
5050 ":exc:" ,
5151 ":issue:" ,
5252 ":attr:" ,
5353 ":c:func:" ,
5454 ":ref:" ,
5555 ":const:" ,
5656 ":term:" ,
57- ":data:" ,
57+ "(?<!:c|py) :data:" ,
5858 ":keyword:" ,
5959 ":file:" ,
6060 ":pep:" ,
128128# :const:`None`
129129role_with_no_backticks = re .compile (r"%s[^` ]" % all_roles )
130130
131+ # Find role glued with another word like:
132+ # the:c:func:`PyThreadState_LeaveTracing` function.
133+ # instad of:
134+ # the :c:func:`PyThreadState_LeaveTracing` function.
135+ role_glued_with_word = re .compile (r"[a-zA-Z]%s" % all_roles )
131136
132137default_role_re = re .compile (r"(^| )`\w([^`]*?\w)?`($| )" )
133138leaked_markup_re = re .compile (r"[a-z]::\s|`|\.\.\s*\w+:" )
@@ -176,6 +181,8 @@ def check_suspicious_constructs(fn, lines):
176181 yield lno , "role use a single backtick, double backtick found."
177182 if role_with_no_backticks .search (line ):
178183 yield lno , "role use a single backtick, no backtick found."
184+ if role_glued_with_word .search (line ):
185+ yield lno , "missing space before role"
179186 if ".. productionlist::" in line :
180187 inprod = True
181188 elif not inprod and default_role_re .search (line ):
You can’t perform that action at this time.
0 commit comments