-
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
Add new lint doc_overindented_list_items
#13711
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Centri3 (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
☔ The latest upstream changes (presumably 19426bf) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Implementation looks good to me, but I think it's best as a separate lint instead. As a separate lint it can still use the same code of course.
tests/ui/doc/doc_lazy_list.fixed
Outdated
/// }, | ||
/// { | ||
/// 'data': 0x0105 # to indicate 1.5 | ||
/// } |
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.
It would be good to add error annotations here for consistency, like has already been done with it having no indentation.
tests/ui/doc/doc_lazy_list.stderr
Outdated
| ^^^^^^^^^^^^^ | ||
| | ||
= help: if this is supposed to be its own paragraph, add a blank line | ||
help: indent this line |
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.
copy+paste error? Over-indenting and under-indenting both say this.
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.
Ah, yes. I'll change them for over-indenting cases. Thanks.
Makes sense. I'll make a change. |
Align bullet points and improve indentation in the `Invariants` section of the `GenDisk` struct documentation for better readability. [ Yutaro is also working on implementing the lint we suggested to catch this sort of issue in upstream Rust: rust-lang/rust-clippy#13601 rust-lang/rust-clippy#13711 Thanks a lot! - Miguel ] Fixes: 3253aba ("rust: block: introduce `kernel::block::mq` module") Signed-off-by: Yutaro Ohno <[email protected]> Reviewed-by: Boqun Feng <[email protected]> Acked-by: Andreas Hindborg <[email protected]> Link: https://lore.kernel.org/r/ZxkcU5yTFCagg_lX@ohnotp Signed-off-by: Miguel Ojeda <[email protected]>
b3cda74
to
d518346
Compare
Add a new lint `doc_overindented_list_items` to detect and fix list items in docs that are overindented. For example, ```rs /// - first line /// second line fn foo() {} ``` this would be fixed to: ```rs /// - first line /// second line fn foo() {} ``` This lint improves readabiliy and consistency in doc.
d518346
to
f33f47d
Compare
doc_overindented_list_items
Just an initial comment: By "use the same code", I mean be in the same module :) Your original code is perfect in that regard, it just needs some refactoring to make it clear it's not just lazy continuation. Two lints can use the same code yet still emit different lints in both |
Add a new lint
doc_overindented_list_items
to detect and fix list itemsin docs that are overindented.
For example,
this would be fixed to:
This lint improves readabiliy and consistency in doc.
.stderr
file)cargo test
passes locallycargo dev update_lints
cargo dev fmt
changelog: [
doc_overindented_list_items
]: Added a new lint that detects overindented list items in docsfixes: #13601