Skip to content

Commit 9c97dd9

Browse files
Fix return to continue in table detection logic (#131)
Co-authored-by: Ezio Melotti <[email protected]>
1 parent 2188172 commit 9c97dd9

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

sphinxlint/checkers.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def check_missing_backtick_after_role(file, lines, options=None):
5555
"""
5656
for paragraph_lno, paragraph in paragraphs(lines):
5757
if paragraph.count("|") > 4:
58-
return # we don't handle tables yet.
58+
continue # we don't handle tables yet.
5959
for error in rst.ROLE_MISSING_CLOSING_BACKTICK_RE.finditer(paragraph):
6060
error_offset = paragraph[: error.start()].count("\n")
6161
yield (
@@ -77,7 +77,7 @@ def check_missing_space_after_literal(file, lines, options=None):
7777
"""
7878
for paragraph_lno, paragraph in paragraphs(lines):
7979
if paragraph.count("|") > 4:
80-
return # we don't handle tables yet.
80+
continue # we don't handle tables yet.
8181
paragraph = clean_paragraph(paragraph)
8282
for role in _RST_ROLE_RE.finditer(paragraph):
8383
if not _END_STRING_SUFFIX_RE.match(role[0][-1]):
@@ -101,7 +101,7 @@ def check_unbalanced_inline_literals_delimiters(file, lines, options=None):
101101
"""
102102
for paragraph_lno, paragraph in paragraphs(lines):
103103
if paragraph.count("|") > 4:
104-
return # we don't handle tables yet.
104+
continue # we don't handle tables yet.
105105
paragraph = clean_paragraph(paragraph)
106106
for lone_double_backtick in _LONE_DOUBLE_BACKTICK_RE.finditer(paragraph):
107107
error_offset = paragraph[: lone_double_backtick.start()].count("\n")
@@ -135,7 +135,7 @@ def check_default_role(file, lines, options=None):
135135
and stripped_line.count("|") >= 4
136136
and "|" in match.group(0)
137137
):
138-
return # we don't handle tables yet.
138+
continue # we don't handle tables yet.
139139
if _ends_with_role_tag(before_match):
140140
# It's not a default role: it ends with a tag.
141141
continue
@@ -279,7 +279,7 @@ def check_role_with_double_backticks(file, lines, options=None):
279279
if "`" not in paragraph:
280280
continue
281281
if paragraph.count("|") > 4:
282-
return # we don't handle tables yet.
282+
continue # we don't handle tables yet.
283283
paragraph = escape2null(paragraph)
284284
while True:
285285
inline_literal = min(
@@ -310,7 +310,7 @@ def check_missing_space_before_role(file, lines, options=None):
310310
"""
311311
for paragraph_lno, paragraph in paragraphs(lines):
312312
if paragraph.count("|") > 4:
313-
return # we don't handle tables yet.
313+
continue # we don't handle tables yet.
314314
paragraph = clean_paragraph(paragraph)
315315
for match in rst.ROLE_GLUED_WITH_WORD_RE.finditer(paragraph):
316316
error_offset = paragraph[: match.start()].count("\n")
@@ -335,7 +335,7 @@ def check_missing_space_before_default_role(file, lines, options=None):
335335
"""
336336
for paragraph_lno, paragraph in paragraphs(lines):
337337
if paragraph.count("|") > 4:
338-
return # we don't handle tables yet.
338+
continue # we don't handle tables yet.
339339
paragraph = clean_paragraph(paragraph)
340340
paragraph = rst.INTERPRETED_TEXT_RE.sub("", paragraph)
341341
for role in rst.inline_markup_gen(
@@ -361,7 +361,7 @@ def check_hyperlink_reference_missing_backtick(file, lines, options=None):
361361
"""
362362
for paragraph_lno, paragraph in paragraphs(lines):
363363
if paragraph.count("|") > 4:
364-
return # we don't handle tables yet.
364+
continue # we don't handle tables yet.
365365
paragraph = clean_paragraph(paragraph)
366366
paragraph = rst.INTERPRETED_TEXT_RE.sub("", paragraph)
367367
for hyperlink_reference in _HYPERLINK_REFERENCE_RE.finditer(paragraph):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. expect: role missing closing backtick: ':role:`foo\n' (missing-backtick-after-role)
2+
3+
+--------------+----------+-----------+-----------+
4+
| row 1, col 1 | column 2 | column 3 | column 4 |
5+
+--------------+----------+-----------+-----------+
6+
| :role:`bar | | | |
7+
+--------------+----------+-----------+-----------+
8+
9+
:role:`foo

0 commit comments

Comments
 (0)