Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print multiple errors at once #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

A5rocks
Copy link

@A5rocks A5rocks commented Sep 18, 2024

This is a very basic .search -> .finditer replacement.

There's a few rules where this isn't wanted, because e.g. there's only one possible construct that could fail or because they provide no information in the error message.

Fixes #119

@@ -126,8 +125,7 @@ def check_default_role(file, lines, options=None):
for lno, line in enumerate(lines, start=1):
line = clean_paragraph(line)
line = escape2null(line)
match = rst.INTERPRETED_TEXT_RE.search(line)
if match:
for match in rst.INTERPRETED_TEXT_RE.finditer(line):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this because all the error messages are the same. On the other hand, this does potentially mean this rules catches offenses that previously it missed (because it just looked at the first possibility).

@A5rocks

This comment was marked as resolved.

@hugovk

This comment was marked as resolved.

@CAM-Gerlach

This comment was marked as resolved.

@AlexWaygood

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnecessary-parenthesis only catches a single error per line
4 participants