When debugging a Clippy lint, I often find myself adding a bunch of debugprint, and commenting out all the code in a test file other than the part I want to test, to avoid getting flooded by the debug output. But those commented-out parts almost always contain error patterns, and apparently ui_test doesn't like having commented-out error patterns, failing with a message like this:
error: comment looks suspiciously like a test suite command: `~^ clippy::unnecessary_cast`
All `//@` test suite commands must be at the start of the line.
The `//` must be directly followed by `@` or `~`.
--> tests/ui/aa.rs:3:10
|
3 | // //~^ clippy::unnecessary_cast
| ^
|
Being a hard error, this stops the testing completely, which requires me to go and completely remove the lines with error patterns, and restore them through Git afterwards... a bit cumbersome.
I'd see 2 ways to solve this:
- downgrade this error to a warning
- recognize commented-out error patterns in particular, and don't warn at them at all
WDYT? I'm willing to implement the solutions presented, but if you have any other ideas, I'd probably be able to implement them as well
When debugging a Clippy lint, I often find myself adding a bunch of debugprint, and commenting out all the code in a test file other than the part I want to test, to avoid getting flooded by the debug output. But those commented-out parts almost always contain error patterns, and apparently ui_test doesn't like having commented-out error patterns, failing with a message like this:
Being a hard error, this stops the testing completely, which requires me to go and completely remove the lines with error patterns, and restore them through Git afterwards... a bit cumbersome.
I'd see 2 ways to solve this:
WDYT? I'm willing to implement the solutions presented, but if you have any other ideas, I'd probably be able to implement them as well