We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6e81e4 commit a004288Copy full SHA for a004288
sphinxlint/checkers.py
@@ -461,10 +461,12 @@ def check_block(block_lineno, block):
461
yield from errors
462
463
464
+_DANGLING_HYPHEN_RE = re.compile(r".*[a-z]-$")
465
+
466
@checker(".rst", rst_only=True)
467
def check_dangling_hyphen(file, lines, options):
468
"""Check for lines ending in a hyphen."""
469
for lno, line in enumerate(lines):
470
stripped_line = line.rstrip("\n")
- if re.match(r".*[a-z]-$", stripped_line):
471
+ if _DANGLING_HYPHEN_RE.match(stripped_line):
472
yield lno + 1, f"Line ends with dangling hyphen"
0 commit comments