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] [thread-next>] [day] [month] [year] [list]
Message-ID: <M4qWISlO9z_OnOQGC5Gqb0ROgBLsxM35tR9HU_DMJKExPFpJrEYTuBa2mO5YQqvQK4h65hZrNB165qJlOnexLXaDscRuZcmAkOC0AH4SO04=@proton.me>
Date: Sat, 07 Sep 2024 14:22:07 +0000
From: Patrick Miller <paddymills@...ton.me>
To: Joe Perches <joe@...ches.com>
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, 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 Saturday, September 7th, 2024 at 7:57 AM, Patrick Miller <paddymills@...ton.me> wrote:

> 

> 

> 

> 

> 

> 

> 

> On Saturday, September 7th, 2024 at 6:53 AM, Joe Perches joe@...ches.com wrote:
> 

> > On Fri, 2024-09-06 at 18:05 +0000, Patrick Miller wrote:
> > 

> > > Adds a check for documentation in rust file. Warns if certain known
> > > documentation headers are not plural. Even though some sections may
> > > be singular (i.e. only one example), the header should still be plural
> > > so that more examples can be added later without needing to change the
> > > header.
> > > 

> > > Fixed the whitespace issue on my previous patch.
> > 

> > Well, one of them.
> > 

> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > 

> > []
> > 

> > > @@ -3900,6 +3900,13 @@ 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|Guarantee|Panic)\s*$/) {
> > > + WARN( "RUST_DOC_HEADER",
> > > + "Rust doc headers should be plural\n" . $herecurr );
> > 

> > There is no autoformatter for checkpatch/perl/etc.
Can you elaborate on what you mean by this? I'm not following.
Is there documentation you can point me to that I need to review?
> > 

> > Continuation && on previous line
> 

> Will fix this. Is there a code style document for the perl scripts?
> 

> > No space after open paren
> > Align to open paren
> > No space before close paren
> 

> I based my coding style off of the if statement directly above mine,
> although I did miss the continuation of &&
Sorry, looked at this again and realize you're talking about the `WARN` statement.
> 

> > I think this is an overly trivial addition.
> 

> I am responding to an issue that is part of rust-for-linux. Maybe
> Miguel Ojeda has something to add on this matter?

Download attachment "signature.asc" of type "application/pgp-signature" (250 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ