-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Detect invalid rustdoc test commands #80617
Detect invalid rustdoc test commands #80617
Conversation
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 can't review the implementation since I'm not familiar with the code and not familiar with the regex style, but the output looks good. Do you want to try adding a failing assertion (like @has ... 'someRandomText'
) and check that the test fails just to make sure this didn't break anything? And you might to re-assign to someone else to review the implementation.
Thanks for fixing this!
src/etc/htmldocck.py
Outdated
print_err( | ||
lineno, | ||
line, | ||
'Invalid command: `!@{0}{1}`, (try with `@!{1}`)'.format( |
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.
Maybe say
'Invalid command: `!@{0}{1}`, (try with `@!{1}`)'.format( | |
'Invalid command: `!@{0}{1}`, (help: try with `@!{1}`)'.format( |
to be consistent with rustc suggestion? Not a big deal though.
c1d5a26
to
da3eef6
Compare
Automatically, it would require a lot of changes. So not sure if it's a good idea... However, just to confirm it works I did a small change and it failed as expected:
|
@bors r+ Thanks! |
📌 Commit da3eef6 has been approved by |
…laumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#80580 (Add suggestion for "ignore" doc code block) - rust-lang#80591 (remove allow(incomplete_features) from std) - rust-lang#80617 (Detect invalid rustdoc test commands) - rust-lang#80628 (reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)) - rust-lang#80646 (Clean up in `each_child_of_item`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Yes, I meant to do a manual test just to make sure it's still picking up the assertions :) |
Fixes #80570.
There are now errors displayed in case of bad command syntax:
r? @camelid