Skip to content
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

Overindented lines lint (similar to doc_lazy_continuation) #13601

Closed
ojeda opened this issue Oct 24, 2024 · 4 comments · Fixed by #13711
Closed

Overindented lines lint (similar to doc_lazy_continuation) #13601

ojeda opened this issue Oct 24, 2024 · 4 comments · Fixed by #13711
Labels
A-lint Area: New lints

Comments

@ojeda
Copy link
Contributor

ojeda commented Oct 24, 2024

What it does

The lint reports overindented lines, for instance in bullet lists (and potentially elsewhere?).

This could perhaps be considered a false negative of doc_lazy_continuation, but "lazy continuation lines" only cover removing indentation, not adding it.

Advantage

The advantages would be similar to doc_lazy_continuation:

  • Clearer (easier to read) documentation in plain text form, i.e. unrendered, which is important in some projects.

  • More consistency in documentation comments across a project (and across different projects, for those that enable the lint).

Drawbacks

No response

Example

/// - a
///    b
pub fn f() {}

Could be written as:

/// - a
///   b
pub fn f() {}
@ohno418
Copy link
Contributor

ohno418 commented Nov 4, 2024

Just a quick report for future work.

I was working on this for a bit, and found some difficulties in automatically applying this rule.

For example, doc like

/// - First line. Here's an sample object:
///   {
///      'protocol': 25,
///      'data': 0xffff
///   }
/// - Second line.

would be fixed into:

/// - First line. Here's an sample object:
///   {
///   'protocol': 25,
///   'data': 0xffff
///   }
/// - Second line.

Similar UI test exists here:

/// * `protocol_descriptors`: A Json Representation of the ProtocolDescriptors
/// to set up. Example:
/// 'protocol_descriptors': [
//~^ ERROR: doc list item without indentation
/// {
/// 'protocol': 25, # u64 Representation of ProtocolIdentifier::AVDTP
/// 'params': [
/// {
/// 'data': 0x0103 # to indicate 1.3
/// },
/// {
/// 'data': 0x0105 # to indicate 1.5
/// }
/// ]
/// },
/// {
/// 'protocol': 1, # u64 Representation of ProtocolIdentifier::SDP
/// 'params': [{
/// 'data': 0x0019
/// }]
/// }
/// ]
//~^ ERROR: doc list item without indentation

@ojeda
Copy link
Contributor Author

ojeda commented Nov 4, 2024

Thanks for taking a look!

For example, doc like

If I understand correctly, that doc is wrong but for other reasons, which makes it hard to offer fixes for; i.e. it should be e.g.

/// - First line. Here's an sample object:
///   ```json
///   {
///      'protocol': 25,
///      'data': 0xffff
///   }
///   ```
/// - Second line.

In any case, please note that even if the lint does not offer fixes (automatic or not), it would still be valuable to have it!

For instance, here it would have detected that broken documentation text.

@ohno418
Copy link
Contributor

ohno418 commented Nov 5, 2024

doc is wrong but for other reasons

Yeah, you're right.
So, it seems like doc in tests/ui/doc/doc_lazy_list.rs test is also wrong, and we should modify it together.

In any case, please note that even if the lint does not offer fixes (automatic or not), it would still be valuable to have it!

Agreed.

I'll probably take another look later. Thanks!

@ojeda
Copy link
Contributor Author

ojeda commented Nov 5, 2024

Yeah, that last example in tests/ui/doc/doc_lazy_list.rs looks broken to me; however, it seems it was added to test for an ICE (from the comment linked there), i.e. it may be intentionally broken, which would be fine since it is a test. Thanks!

ojeda pushed a commit to Rust-for-Linux/linux that referenced this issue Dec 18, 2024
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]>
github-merge-queue bot pushed a commit that referenced this issue Jan 28, 2025
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.

---

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

[lint_naming]:
https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints

changelog: [`doc_overindented_list_items`]: Added a new lint that
detects overindented list items in docs
fixes: #13601
ojeda added a commit to Rust-for-Linux/linux that referenced this issue Feb 12, 2025
Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. ]
Signed-off-by: Miguel Ojeda <[email protected]>
ojeda added a commit to Rust-for-Linux/linux that referenced this issue Feb 12, 2025
Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
senekor pushed a commit to senekor/linux that referenced this issue Feb 15, 2025
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]>
github-actions bot pushed a commit to anon503/linux that referenced this issue Feb 18, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Feb 19, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
github-actions bot pushed a commit to anon503/linux that referenced this issue Feb 19, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Feb 20, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
github-actions bot pushed a commit to anon503/linux that referenced this issue Feb 20, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Feb 21, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
github-actions bot pushed a commit to sirdarckcat/linux-1 that referenced this issue Feb 21, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue Feb 21, 2025
commit 2e4f982 upstream.

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
jannau pushed a commit to AsahiLinux/linux that referenced this issue Mar 1, 2025
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]>
github-actions bot pushed a commit to anon503/linux that referenced this issue Mar 10, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
github-actions bot pushed a commit to anon503/linux that referenced this issue Mar 10, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
github-actions bot pushed a commit to anon503/linux that referenced this issue Mar 10, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this issue Mar 11, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Kaz205 pushed a commit to Kaz205/linux that referenced this issue Mar 11, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
gregkh pushed a commit to gregkh/linux that referenced this issue Mar 13, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
gregkh pushed a commit to gregkh/linux that referenced this issue Mar 13, 2025
commit 0c5928d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
aaron-ang pushed a commit to aaron-ang/kvm that referenced this issue Mar 15, 2025
Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have
a new lint, `doc_overindented_list_items` [1], which catches cases of
overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928d ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a few cases in the kernel, apart from the one already
fixed in the commit above. One is this one:

    error: doc list item overindented
        --> rust/kernel/rbtree.rs:1152:5
         |
    1152 | ///     null, it is a pointer to the root of the [`RBTree`].
         |     ^^^^ help: try using `  ` (2 spaces)
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
         = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings`
         = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]`

Thus clean it up.

Cc: Yutaro Ohno <[email protected]>
Cc: [email protected] # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes: a335e95 ("rust: rbtree: add `RBTree::entry`")
Link: rust-lang/rust-clippy#13711 [1]
Link: rust-lang/rust-clippy#13601 [2]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Yutaro Ohno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ There are a few other cases, so updated message. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants