-
-
Notifications
You must be signed in to change notification settings - Fork 20
Print multiple errors at once #121
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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): |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you give an example repro to trigger this?
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Just wanted to bump this! |
Addressing @AlexWaygood's performance concerns in #119 (comment), here's how the current Sphinx Lint ❯ hyperfine --warmup 3 "sphinx-lint Doc Misc/NEWS.d --enable=default-role" --ignore-failure
Benchmark 1: sphinx-lint Doc Misc/NEWS.d --enable=default-role
Time (mean ± σ): 1.616 s ± 0.034 s [User: 12.088 s, System: 0.696 s]
Range (min … max): 1.580 s … 1.694 s 10 runs
Warning: Ignoring non-zero exit code. And this PR: ❯ hyperfine --warmup 3 "sphinx-lint Doc Misc/NEWS.d --enable=default-role" --ignore-failure
Benchmark 1: sphinx-lint Doc Misc/NEWS.d --enable=default-role
Time (mean ± σ): 1.680 s ± 0.021 s [User: 12.671 s, System: 0.699 s]
Range (min … max): 1.657 s … 1.728 s 10 runs
Warning: Ignoring non-zero exit code. The PR's time (1.68) is 0.96 times as fast as (96.19%) as the first time (1.616). Is that acceptable? |
That seems fine to me! Thanks for checking! |
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