-
Notifications
You must be signed in to change notification settings - Fork 13.3k
add a lowercase suggestion to unknown_lints #44104
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
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
r? @nikomatsakis Did someone add a check for "suggestion" in @rust-highfive to assign me?! |
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.
Feels like a rather niche use case, but it's only a few lines of code, so... probably fine. Still, let's at least clean up the tests a bit.
src/test/ui/lint/not_found.rs
Outdated
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#[allow(foo_bar)] |
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 would expect to see this be #[allow(FOO_BAR)]
, to show that the suggestion does not fire for nonsense lints...is there a reason you chose foo_bar
?
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.
This is testing the default behavior as a baseline.
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
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.
Can you add a comment explaining the purpose of this test is to test the "lint case" suggestion?
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.
Will do.
I will re-jiggle the tests and add some comments when I get to my PC. |
@bors r+ |
📌 Commit fa6c605 has been approved by |
⌛ Testing commit fa6c605e00a72790ae6a34dc811a08262de6a548 with merge b26980dfb2223bcd2e23fcdefaee8816a6d3724b... |
💔 Test failed - status-travis |
src/test/ui/lint/not_found.stderr
Outdated
| ^^^^^^^^^ help: lowercase the lint name: `dead_code` | ||
|
||
warning: unknown lint: `Warnings` | ||
--> $DIR/not_found.rs:13:8 |
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.
The line numbers are wrong.
-warning: unknown lint: `foo_bar`
- --> $DIR/not_found.rs:11:9
+warning: unknown lint: `FOO_BAR`
+ --> $DIR/not_found.rs:14:9
|
14 | #[allow(FOO_BAR)]
| ^^^^^^^
|
= note: #[warn(unknown_lints)] on by default
warning: unknown lint: `DEAD_CODE`
- --> $DIR/not_found.rs:12:8
+ --> $DIR/not_found.rs:16:8
|
16 | #[warn(DEAD_CODE)]
| ^^^^^^^^^ help: lowercase the lint name: `dead_code`
warning: unknown lint: `Warnings`
- --> $DIR/not_found.rs:13:8
+ --> $DIR/not_found.rs:18:8
|
18 | #[deny(Warnings)]
| ^^^^^^^^ help: lowercase the lint name: `warnings`
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.
Yeah, sorry about that. Me, at a bus stop, with slow, intermittent 3G connection trying to fake compiletest (because rustbuild doesn't like connection timeouts). Let's try that again.
Travis gives this result:
|
f49edd4
to
b1d9bd8
Compare
What the git? I wanted to rebase this with the first comment, not with the stuff you see there. At least the tests no longer fail. |
b1d9bd8
to
ba643fa
Compare
@nikomatsakis sorry for wasting your time and thank you for the thorough review. I only fixed the commit message, the tests should run through as is. |
@bors r+ |
📌 Commit ba643fa has been approved by |
@llogiq not to worry! travis looks green now =) |
⌛ Testing commit ba643fa with merge 34e6788ba1edd310e5e66371f592fe9c1b744a03... |
💔 Test failed - status-travis |
@bors: retry
|
add a lowercase suggestion to unknown_lints I recently wrote some tests for a clippy lint, copied the (uppercase) lint name into my test file and forgot to toggle the case. This PR adds a suggestion that would have saved me 10 minutes of debugging, so it's likely a net win 🙂 . Also it adds a UI test for the `unknown_lints` lint.
☀️ Test successful - status-appveyor, status-travis |
I recently wrote some tests for a clippy lint, copied the (uppercase) lint name into my test file and forgot to toggle the case. This PR adds a suggestion that would have saved me 10 minutes of debugging, so it's likely a net win 🙂 . Also it adds a UI test for the
unknown_lints
lint.