Skip to contentSkip to conversation

rust: macros: fix indentation in `module!`'s doc comment

PATCH In review Yutaro Ohno 3 participants 5 messages Aug 13, 2024 – Aug 14, 2024 Rust

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: macros: fix indentation in `module!`'s doc comment

Clippy warns about list content in a doc comment that doesn't have extra spaces at the beginning of a new line [1], like this:

```rust
/// * Do nothing.
/// * Then do something. Whatever it is needs done,
/// it should be done right now.
```

The suggested format is:

```rust
/// * Do nothing.
/// * Then do something. Whatever it is needs done,
///   it should be done right now.
```

This commit adds extra indentation to the module!'s doc comment to suppress the warning.

---
 rust/macros/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/macros/lib.rs +1 -1
index 159e75292970..5be0cb9db3ee 100644
@@ -94,7 +94,7 @@
 ///   - `license`: ASCII string literal of the license of the kernel module (required).
 ///   - `alias`: array of ASCII string literals of the alias names of the kernel module.
 ///   - `firmware`: array of ASCII string literals of the firmware files of
-/// the kernel module.
+///     the kernel module.
 #[proc_macro]
 pub fn module(ts: TokenStream) -> TokenStream {
     module::module(ts)
Signature · 1 line
2.46.0
#1 lore raw
Quoted 18 lines · Yutaro Ohno

Clippy warns about list content in a doc comment that doesn't have extra spaces at the beginning of a new line [1], like this:

```rust
/// * Do nothing.
/// * Then do something. Whatever it is needs done,
/// it should be done right now.
```

The suggested format is:

```rust
/// * Do nothing.
/// * Then do something. Whatever it is needs done,
///   it should be done right now.
```
Quoted 5 lines

This commit adds extra indentation to the module!'s doc comment to suppress the warning.

Thanks Yutaro -- this was fixed already in the rust-fixes branch, which is going to Linus soon.

Nevertheless, the patch looks good to me, and it has a nice commit message! :)

Cheers,
Miguel

#2 lore raw
Quoted 25 lines · Miguel Ojeda
Quoted 18 lines · Yutaro Ohno

Clippy warns about list content in a doc comment that doesn't have extra spaces at the beginning of a new line [1], like this:

```rust
/// * Do nothing.
/// * Then do something. Whatever it is needs done,
/// it should be done right now.
```

The suggested format is:

```rust
/// * Do nothing.
/// * Then do something. Whatever it is needs done,
///   it should be done right now.
```
Quoted 5 lines

This commit adds extra indentation to the module!'s doc comment to suppress the warning.

Quoted 7 lines

Thanks Yutaro -- this was fixed already in the rust-fixes branch, which is going to Linus soon.

Nevertheless, the patch looks good to me, and it has a nice commit message! :)

Cheers,
Miguel

Oh, I see. Thank you for letting me know!

Thanks,
Yutaro

#3 lore raw

Additional patches for rust-fixes? (was: Re: [PATCH] rust: macros: fix indentation in `module!`'s doc comment)

In reply to Miguel Ojeda

On 13.08.2024 15:14, Miguel Ojeda wrote:
...

Quoted 2 lines

the rust-fixes branch,
which is going to Linus soon.

Sorry for being off-topic ;)

But would it make sense to try to get the (not existing yet) fixes for the bss symbols export and the lockdep key registration topics identified in

https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/6.2E11.2E0-rc1.3A.20rust.2Fkernel.2Fblock.2Fmq.2Ers.3A.20doctest.20lock.20warning/near/460073942

into this -rc cycle, still?

Best regards

Dirk

#4 lore raw

Re: Additional patches for rust-fixes? (was: Re: [PATCH] rust: macros: fix indentation in `module!`'s doc comment)

Quoted 7 lines · Dirk Behme

But would it make sense to try to get the (not existing yet) fixes for the bss symbols export and the lockdep key registration topics identified in

https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/6.2E11.2E0-rc1.3A.20rust.2Fkernel.2Fblock.2Fmq.2Ers.3A.20doctest.20lock.20warning/near/460073942

into this -rc cycle, still?

That would delay what we already have ready, and we don't even have patches for those in the list yet. So I prefer to send another PR later if needed.

Cheers,
Miguel