-
Notifications
You must be signed in to change notification settings - Fork 1.6k
add --explain
subcommand
#8952
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
add --explain
subcommand
#8952
Conversation
r? @dswij (rust-highfive has picked a reviewer for you, use r? to override) |
I started out trying to get a proc macro to work, but then I found Alexey Kladow's blog post about self-modifying code and I thought this might be just the right application for the technique. |
This one looks interesting, and my reviewing queue is currently relatively small. I would take over the review. (If you want to keep it @dswij, feel free to say so) r? @xFrednet @llogiq could you maybe link the blog post? Your comment reminded me of a post, I've read before. Also, as a side node, I sometimes find it confusing, when to use the double dashes after |
Updated my previus comment with the link. |
24aabfe
to
2f1e1ab
Compare
Sure, go ahead! |
@xFrednet I'm fine with merging this & doing a follow-up for cargo-clippy later. |
I noted that -E is already used for "error". |
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 implementation itself looks good to be. I haven't done a full test, but the initial tries seem good.
While I like the concept of using a test, it feels a bit off in Clippy's codebase since we already do this kind of generation in clippy_dev
. This introduces another location with little benefit in comparison to adding it to clippy_dev
. At least that's my impression. clippy_dev
doesn't have the regex crate, but that should be simple to avoid/rewrite.
cc: @Serial-ATA This might be interesting, since you're working on the metadata collection/lint list. Feel free to ignore this as well 🙃
Couldn't |
collect-metadata is only run during deployment and not even in bors CI. However, collect-metadata could use this file to generate the documentation instead of doing it itself. |
This would be a really cool thing to have -- especially if we can somehow add this feature to rust-analyzer. Thank you for your work! |
So, I see two ways to improve on this:
|
This version should deal with the merge conflicts arising from doc changes. I didn't get to changing the code to use |
908fd36
to
9a29ad3
Compare
Hmmm...I should not name the files ".md" when they don't contain markdown... |
d44f5da
to
dac973a
Compare
With the following force-push, I removed the final newline from the md files as well as @dswij r? |
Sorry, for the late replay, I moved last week and life is currently still a bit chaotic. Reviewing this is on my todo list for this weekend. If @dswij want's to take over that would also be fine for 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.
Overall, looks good to me. I also like the location in cargo-clippy
. I've also played around with it and to works well :). My GitHub is actually struggling a bit with this many changes ^^.
Thank you for your patience, the last weeks have been very full for me 😅
Hey @rust-lang/clippy, this PR adds the |
I need to rebase to make the tests work. |
cecbf99
to
2256267
Compare
We discussed wanting this three meetings ago, and I agreed to implement it. I don't think there were any objections during that meeting. Re the implementation: Splitting the files and using |
I just wanted to make sure now that we had an actual implementation to play around with. It looks like everyone is cool with this :) This looks good to me, you can |
@bors r=xFredNet |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Thank you for the review, @xFrednet. |
This closes #8291.
changelog: add
cargo clippy -- --explain <lintname>
subcommand