Re: [PATCH v3 2/2 RESEND] checkpatch: warn on empty rust doc comments

From: Trevor Gross
Date: Sun Sep 29 2024 - 18:15:34 EST


On Sun, Sep 29, 2024 at 7:16 AM Hridesh MG <hridesh699@xxxxxxxxx> wrote:

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 39032224d504..c75bc3927bf6 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3884,6 +3884,13 @@ sub process {
> }
> }
>
> +# check for consecutive empty /// lines in .rs files
> + if ($realfile =~ /\.rs$/ &&
> + $rawline =~ /^\+\s*\/\/\/$/ && $prevrawline =~ /^\+\s*\/\/\/$/) {
> + WARN("RUST_DOC_EMPTY",
> + "avoid using consecutive empty rustdoc comments\n" . $herecurr);
> + }
> +

We got a request to add a rust-specific block in another patchset [1].
It would probably be good to coordinate here and have a patch adding
an empty block, to be used by both of these changes.

[1]: https://lore.kernel.org/rust-for-linux/a9112679-b251-4b98-b55e-e8aabf82ad46@xxxxxxxxx/