Skip to content

Commit 44056e0

Browse files
committed
Two false positives fixed.
1 parent 999b43d commit 44056e0

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

sphinxlint.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@
151151
# The :exc:`Exception`s
152152
# instead of:
153153
# The :exc:`Exceptions`\ s
154-
role_body = r"([^`]|\s`+|\\`)+"
155154
role_missing_surrogate_escape = re.compile(
156-
rf"{role_head}`{role_body}(?<![\\\s`])`(?!{end_string_suffix})"
155+
rf"{role_head}`[^`]+?(?<![\\\s`])`(?!{end_string_suffix})"
157156
)
158157

159158
# TODO: cover more cases
@@ -201,7 +200,7 @@ def is_in_a_table(error, line):
201200
return "|" in line[: error.start()] and "|" in line[error.end() :]
202201

203202

204-
role_missing_closing_backtick = re.compile(rf"({role_head}`{role_body})[^`]*$")
203+
role_missing_closing_backtick = re.compile(rf"({role_head}`[^`]+?)[^`]*$")
205204

206205

207206
def check_paragraph(paragraph_lno, paragraph):
@@ -231,6 +230,7 @@ def check_suspicious_constructs_in_paragraphs(file, lines):
231230
yield from check_paragraph(paragraph_lno, "".join(paragraph))
232231

233232

233+
role_body = r"([^`]|\s`+|\\`)+"
234234
backtick_in_front_of_role = re.compile(rf"(^|\s)`:{simplename}:`{role_body}`")
235235

236236

@@ -370,25 +370,6 @@ def type_of_explicit_markup(line):
370370
return "comment"
371371

372372

373-
glued_inline_literals = re.compile(
374-
rf"{start_string_prefix}(``[^`]+?(?!{start_string_prefix})``)(?!{end_string_suffix})"
375-
)
376-
377-
378-
@checker(".rst", severity=2)
379-
def check_missing_surrogate_space_on_plural(file, lines):
380-
r"""Check for missing 'backslash-space' between a code sample a letter.
381-
382-
Good: ``Point``\ s
383-
Bad: ``Point``s
384-
"""
385-
for lno, line in enumerate(hide_non_rst_blocks(lines)):
386-
match = glued_inline_literals.search(line)
387-
if match and match.start() != 0:
388-
literal = match.group(2)
389-
yield lno + 1, f"Missing backslash-space between literal {literal} (column {match.start()!r})."
390-
391-
392373
triple_backticks = re.compile(
393374
rf"(?:{start_string_prefix})```[^`]+?(?<!{start_string_prefix})```(?:{end_string_suffix})"
394375
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``setuptools`` therefore provides two convenient tools to ease the
2+
burden: :literal:`find:\ ` and :literal:`find_namespace:\ `.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Yes, ``'a' + u'bc'`` is ``u'abc'``.

0 commit comments

Comments
 (0)