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

From: Patrick Miller
Date: Sun Sep 29 2024 - 22:42:06 EST







On Sunday, September 29th, 2024 at 6:15 PM, Trevor Gross <tmgross@xxxxxxxxx> wrote:

>

>

> 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/

After the latest revision of my patch [1], I split the if statement so that
there is a parent check for rust files for future rust patch checks. So,
this would perfectly fit within that block.

Do you want me to add your code and credit you in my patch?


[1]: https://lore.kernel.org/rust-for-linux/20240914181618.837227-2-paddymills@xxxxxxxxx/

Attachment: signature.asc
Description: OpenPGP digital signature