Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
mattwang44 and hugovk committed Aug 28, 2024
1 parent ad11bdf commit ec6262e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sphinxlint/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,16 @@ def check_dangling_hyphen(file, lines, options):
yield lno + 1, "Line ends with dangling hyphen"


@checker(".rst", ".po", rst_only=False)
@checker(".rst", ".po", rst_only=False, enabled=False)
def check_unnecessary_func_parentheses(filename, lines, options):
"""Check for unnecessary parentheses in :func: roles.
Bad: :func:`test()`
Good: :func:`test`
TODO: The checker is disabled since some of the friend projects does not follow
this new rule. We should enable it once the issues are all resolved.
"""
for lno, line in enumerate(lines, start=1):
match = rst.FUNC_ROLE_WITH_UNNECESSARY_PARENTHESES.search(line)
if match:
if match := rst.FUNC_ROLE_WITH_UNNECESSARY_PARENTHESES.search(line):
yield lno, f"Unnecessary parentheses in {match.group(0).strip()!r}"

0 comments on commit ec6262e

Please sign in to comment.