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]
Date:   Wed, 14 Oct 2020 11:35:25 -0700
From:   Joe Perches <joe@...ches.com>
To:     Dwaipayan Ray <dwaipayanray1@...il.com>
Cc:     linux-kernel-mentees@...ts.linuxfoundation.org,
        linux-kernel@...r.kernel.org, lukas.bulwahn@...il.com
Subject: Re: [PATCH v2] checkpatch: add new exception to repeated word check

On Wed, 2020-10-14 at 23:42 +0530, Dwaipayan Ray wrote:
> On Wed, Oct 14, 2020 at 11:33 PM Joe Perches <joe@...ches.com> wrote:
> > On Wed, 2020-10-14 at 22:07 +0530, Dwaipayan Ray wrote:
> > > Recently, commit 4f6ad8aa1eac ("checkpatch: move repeated word test")
> > > moved the repeated word test to check for more file types. But after
> > > this, if checkpatch.pl is run on MAINTAINERS, it generates several
> > > new warnings of the type:
> > 
> > Perhaps instead of adding more content checks so that
> > word boundaries are not something like \S but also
> > not punctuation so that content like
> > 
> >         git git://
> >         @size size
> > 
> > does not match?
> > 
> > 
> Hi,
> So currently the words are trimmed of non alphabets before the check:
> 
> while ($rawline =~ /\b($word_pattern) (?=($word_pattern))/g) {
> my $first = $1;
> my $second = $2;
> 
> where, the word_pattern is:
> my $word_pattern = '\b[A-Z]?[a-z]{2,}\b';

I'm familiar.

> So do you perhaps recommend modifying this word pattern to
> include the punctuation as well rather than trimming them off?

Not really, perhaps use the capture group position
markers @- @+ or $-[1] $+[1] and $-[2] $+[2] with the
substr could be used to see what characters are
before and after the word matches.
> 
> Thanks,
> Dwaipayan.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ