lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2024090628-bankable-refusal-5f20@gregkh>
Date: Fri, 6 Sep 2024 19:56:55 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Patrick Miller <paddymills@...ton.me>
Cc: a.hindborg@...sung.com, alex.gaynor@...il.com, aliceryhl@...gle.com,
	apw@...onical.com, benno.lossin@...ton.me, bjorn3_gh@...tonmail.com,
	boqun.feng@...il.com, dwaipayanray1@...il.com, gary@...yguo.net,
	joe@...ches.com, linux-kernel@...r.kernel.org,
	lukas.bulwahn@...il.com, ojeda@...nel.org,
	rust-for-linux@...r.kernel.org, tmgross@...ch.edu,
	wedsonaf@...il.com
Subject: Re: [PATCH 2/2] checkpatch: warn on known non-plural rust doc headers

On Fri, Sep 06, 2024 at 05:29:28PM +0000, Patrick Miller wrote:
> 
> 
> 
> 
> 
> On Friday, September 6th, 2024 at 1:00 PM, Greg KH <gregkh@...uxfoundation.org> wrote:
> 
> > 
> 
> > 
> 
> > On Fri, Sep 06, 2024 at 04:45:49PM +0000, Patrick Miller wrote:
> > 
> 
> > > Adds a check for documentation in rust file. Warns if certain known
> > > documentation headers are not plural.
> > > 
> 
> > > Signed-off-by: Patrick Miller paddymills@...ton.me
> > > Suggested-by: Miguel Ojeda ojeda@...nel.org
> > > Link: https://github.com/Rust-for-Linux/linux/issues/1110
> > > 
> 
> > > ---
> > > scripts/checkpatch.pl | 8 ++++++++
> > > 1 file changed, 8 insertions(+)
> > > 
> 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index 39032224d504..0e99d11eeb04 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -3900,6 +3900,14 @@ sub process {
> > > "Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/core-api/asm-annotations.rst\n" . $herecurr);
> > > }
> > > 
> 
> > > +# check that document section headers are plural in rust files
> > > + if ( $realfile =~ /\.rs$/
> > > + && $rawline =~ /^\+\s*\/\/\/\s+#+\s+(Example|Invariant)\s*$/ )
> > > + {
> > > + WARN( "RUST_DOC_HEADER",
> > > + "Rust doc he
> > > aders should be plural\n" . $herecurr );
> > 
> 
> > 
> 
> > Something went wrong, your patch lost the tabs and it had a line wrap?
> My bad! Editor settings strikes again.
> 
> > 
> 
> > And why is Rust unique for plurals here? What if there really is only
> > one example?
> Per Miguel Ojeda (who suggested the issue): "We prefer plurals when writing code documentation sections: # Examples, # Invariants, # Guarantees and # Panics, so that it is consistent and so that one can add more examples without having to change the section name."
> > 
> 
> > thanks,
> > 
> 
> > greg k-h
> 
> I apologize, first time submitting. Do I submit a new email or add the fixed patch to this one?

As this one can't apply, you need to send a whole new one :)


thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ