-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Autogenerate new lints #4994
Autogenerate new lints #4994
Conversation
I will add another commit to update docs once the code is set in stone, but I wanted to push this up before assuming too much. |
6fb9158
to
1a3660f
Compare
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.
Thanks for implementing this!
Initial implementation LGTM overall.
1a3660f
to
c137e23
Compare
c137e23
to
0d7885e
Compare
0d7885e
to
9566021
Compare
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.
Only one thing left 🎉
9566021
to
2a5160c
Compare
Since we seem to be at a good spot with the auto-generated code, I'm going to start working on two more commits for this PR:
|
Great! If you have any questions, don't hesitate to ask! |
2a5160c
to
8008fef
Compare
I've started updating the docs and adding the new lint, but when trying to build I'm getting a ton of errors like this:
I've installed the latest Rust from master but still no success. Any ideas? |
Since the rustc API isn't guaranteed to be stable we often have breaking changes like the ones you see above. For example Here's the rustup PR: #5040. Once this gets merged you would only need to update changes in this PR to be compatible with the latest rustc API. Hope that helps. |
okay cool that makes sense, thank you! I will keep an eye on that PR and proceed once it is merged. |
☔ The latest upstream changes (presumably #5040) made this pull request unmergeable. Please resolve the merge conflicts. |
8008fef
to
5b43751
Compare
I'm not sure how to set up the tests for creating an internal lint ie checking to make sure no lints have |
5b43751
to
9842670
Compare
https://github.com/rust-lang/rust-clippy/blob/master/tests/ui/lint_without_lint_pass.rs Is an example on how to write tests for lint declarations. Just create a test file with similar imports and declare a lint with the description "default lint description" and one with another description. |
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.
Documentation update looks great!
9842670
to
73dced8
Compare
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.
LGTM overrall
- Add option in clippy_dev to automatically generate boilerplate code for adding new lints
- Add instructions for adding new lints with the new automation
- Lint for any new lints that have the default lint description from the automation
73dced8
to
32337a9
Compare
Thanks! @bors r+ |
📌 Commit 32337a9 has been approved by |
Autogenerate new lints Add option in clippy_dev to automatically generate boilerplate code for adding new lints example: `./util/dev new_lint --name=iter_nth_zero --type=late` Fixes #4942
💔 Test failed - checks-travis |
@bors retry |
Autogenerate new lints Add option in clippy_dev to automatically generate boilerplate code for adding new lints example: `./util/dev new_lint --name=iter_nth_zero --type=late` Fixes #4942 changelog: none
💔 Test failed - checks-travis |
@bors retry (spurious) |
Autogenerate new lints Add option in clippy_dev to automatically generate boilerplate code for adding new lints example: `./util/dev new_lint --name=iter_nth_zero --type=late` Fixes #4942 changelog: none
☀️ Test successful - checks-travis, status-appveyor |
Add option in clippy_dev to automatically generate boilerplate code for adding new lints
example:
./util/dev new_lint --name=iter_nth_zero --type=late
Fixes #4942
changelog: none