Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs

2021-02-10 Thread Bjorn Helgaas
On Wed, Feb 10, 2021 at 12:22:35AM -0800, Kees Cook wrote:
> On Thu, Dec 17, 2020 at 04:50:41PM -0800, Joe Perches wrote:
> > On Thu, 2020-12-17 at 17:56 -0600, Bjorn Helgaas wrote:
> > > From: Bjorn Helgaas 
> > > 
> > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > as lore.kernel.org because they use different styles, add advertising, and
> > > may disappear in the future.  The lore archives are more consistent and
> > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > they exist.
> > 
> > Hi Bjorn.
> > 
> > I like the idea, thanks, but a couple notes.
> > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > []
> > > @@ -564,6 +564,17 @@ sub find_standard_signature {
> > >   return "";
> > >  }
> >  
> > > +our $obsolete_archives = qr{(?xi:
> > > + freedesktop.org/archives/dri-devel|
> > > + lists.infradead.org|
> > > + lkml.org|
> > > + mail-archive.com|
> > > + mailman.alsa-project.org/pipermail|
> > > + marc.info|
> > > + ozlabs.org/pipermail|
> > > + spinics.net
> > > +)};
> > 
> > Strictly, these all need \Q \E escaping so uses like lkmlAorg do not match.
> > 
> > 
> > > @@ -3101,6 +3112,12 @@ sub process {
> > >   }
> > >   }
> > >  
> > > +# Check for mailing list archives other than lore.kernel.org
> > > + if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {
> > 
> > The https?:// doesn't seem necessary.  Perhaps:
> > 
> > if ($line =~ m{\b$obsolete_archives}) {
> > 
> > > + WARN("PREFER_LORE_ARCHIVE",
> > > +  "Use lore.kernel.org archive links when possible; 
> > > see https://lore.kernel.org/lists.html\n; . $herecurr);
> > 
> > Perhaps:
> >  "Prefer lore.kernel.org links. see: 
> > https://www.kernel.org/lore.html#linking-to-list-discussions-from-commits\n;
> >  . $herecurr);
> > 
> > So maybe instead:
> > ---
> >  scripts/checkpatch.pl | 17 +
> >  1 file changed, 17 insertions(+)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 00085308ed9d..c2a324d628a6 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -564,6 +564,17 @@ sub find_standard_signature {
> > return "";
> >  }
> >  
> > +our $obsolete_archives = qr{(?xi:
> > +   \Qfreedesktop.org/archives/dri-devel\E |
> > +   \Qlists.infradead.org\E |
> > +   \Qlkml.org\E |
> > +   \Qmail-archive.com\E |
> > +   \Qmailman.alsa-project.org/pipermail\E |
> > +   \Qmarc.info\E |
> > +   \Qozlabs.org/pipermail\E |
> > +   \Qspinics.net\E
> > +)};
> > +
> >  our @typeListMisordered = (
> > qr{char\s+(?:un)?signed},
> > qr{int\s+(?:(?:un)?signed\s+)?short\s},
> > @@ -3101,6 +3112,12 @@ sub process {
> > }
> > }
> >  
> > +   # Check for mailing list archives other than lore.kernel.org
> > +   if ($rawline =~ m{\b$obsolete_archives}) {
> > +   WARN("PREFER_LORE_ARCHIVE",
> > +"Use lore.kernel.org archive links when possible - 
> > see https://lore.kernel.org/lists.html\n; . $herecurr);
> > +   }
> > +
> >  # Check for added, moved or deleted files
> > if (!$reported_maintainer_file && !$in_commit_log &&
> > ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
> > 
> > 
> 
> Ah, nice. Yes, this would be great to get added. Joe, can you respin as
> a full path? Please consider it:

I hate to ask Joe to rework *my* patch just because I've dropped the
ball on it!  Sorry, I'll try to resurrect this.

> Reviewed-by: Kees Cook 


Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs

2021-02-10 Thread Kees Cook
On Thu, Dec 17, 2020 at 04:50:41PM -0800, Joe Perches wrote:
> On Thu, 2020-12-17 at 17:56 -0600, Bjorn Helgaas wrote:
> > From: Bjorn Helgaas 
> > 
> > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > as lore.kernel.org because they use different styles, add advertising, and
> > may disappear in the future.  The lore archives are more consistent and
> > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > they exist.
> 
> Hi Bjorn.
> 
> I like the idea, thanks, but a couple notes.
> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -564,6 +564,17 @@ sub find_standard_signature {
> >     return "";
> >  }
>  
> > +our $obsolete_archives = qr{(?xi:
> > +   freedesktop.org/archives/dri-devel|
> > +   lists.infradead.org|
> > +   lkml.org|
> > +   mail-archive.com|
> > +   mailman.alsa-project.org/pipermail|
> > +   marc.info|
> > +   ozlabs.org/pipermail|
> > +   spinics.net
> > +)};
> 
> Strictly, these all need \Q \E escaping so uses like lkmlAorg do not match.
> 
> 
> > @@ -3101,6 +3112,12 @@ sub process {
> >     }
> >     }
> >  
> > +# Check for mailing list archives other than lore.kernel.org
> > +   if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {
> 
> The https?:// doesn't seem necessary.  Perhaps:
> 
>   if ($line =~ m{\b$obsolete_archives}) {
> 
> > +   WARN("PREFER_LORE_ARCHIVE",
> > +"Use lore.kernel.org archive links when possible; 
> > see https://lore.kernel.org/lists.html\n; . $herecurr);
> 
> Perhaps:
>"Prefer lore.kernel.org links. see: 
> https://www.kernel.org/lore.html#linking-to-list-discussions-from-commits\n; 
> . $herecurr);
> 
> So maybe instead:
> ---
>  scripts/checkpatch.pl | 17 +
>  1 file changed, 17 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 00085308ed9d..c2a324d628a6 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -564,6 +564,17 @@ sub find_standard_signature {
>   return "";
>  }
>  
> +our $obsolete_archives = qr{(?xi:
> + \Qfreedesktop.org/archives/dri-devel\E |
> + \Qlists.infradead.org\E |
> + \Qlkml.org\E |
> + \Qmail-archive.com\E |
> + \Qmailman.alsa-project.org/pipermail\E |
> + \Qmarc.info\E |
> + \Qozlabs.org/pipermail\E |
> + \Qspinics.net\E
> +)};
> +
>  our @typeListMisordered = (
>   qr{char\s+(?:un)?signed},
>   qr{int\s+(?:(?:un)?signed\s+)?short\s},
> @@ -3101,6 +3112,12 @@ sub process {
>   }
>   }
>  
> + # Check for mailing list archives other than lore.kernel.org
> + if ($rawline =~ m{\b$obsolete_archives}) {
> + WARN("PREFER_LORE_ARCHIVE",
> +  "Use lore.kernel.org archive links when possible - 
> see https://lore.kernel.org/lists.html\n; . $herecurr);
> + }
> +
>  # Check for added, moved or deleted files
>   if (!$reported_maintainer_file && !$in_commit_log &&
>   ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
> 
> 

Ah, nice. Yes, this would be great to get added. Joe, can you respin as
a full path? Please consider it:

Reviewed-by: Kees Cook 

-- 
Kees Cook


Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs

2020-12-17 Thread Joe Perches
On Thu, 2020-12-17 at 17:56 -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas 
> 
> The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> as lore.kernel.org because they use different styles, add advertising, and
> may disappear in the future.  The lore archives are more consistent and
> more likely to stick around, so prefer https://lore.kernel.org URLs when
> they exist.

Hi Bjorn.

I like the idea, thanks, but a couple notes.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -564,6 +564,17 @@ sub find_standard_signature {
>   return "";
>  }
 
> +our $obsolete_archives = qr{(?xi:
> + freedesktop.org/archives/dri-devel|
> + lists.infradead.org|
> + lkml.org|
> + mail-archive.com|
> + mailman.alsa-project.org/pipermail|
> + marc.info|
> + ozlabs.org/pipermail|
> + spinics.net
> +)};

Strictly, these all need \Q \E escaping so uses like lkmlAorg do not match.


> @@ -3101,6 +3112,12 @@ sub process {
>   }
>   }
>  
> +# Check for mailing list archives other than lore.kernel.org
> + if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {

The https?:// doesn't seem necessary.  Perhaps:

if ($line =~ m{\b$obsolete_archives}) {

> + WARN("PREFER_LORE_ARCHIVE",
> +  "Use lore.kernel.org archive links when possible; 
> see https://lore.kernel.org/lists.html\n; . $herecurr);

Perhaps:
 "Prefer lore.kernel.org links. see: 
https://www.kernel.org/lore.html#linking-to-list-discussions-from-commits\n; . 
$herecurr);

So maybe instead:
---
 scripts/checkpatch.pl | 17 +
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 00085308ed9d..c2a324d628a6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -564,6 +564,17 @@ sub find_standard_signature {
return "";
 }
 
+our $obsolete_archives = qr{(?xi:
+   \Qfreedesktop.org/archives/dri-devel\E |
+   \Qlists.infradead.org\E |
+   \Qlkml.org\E |
+   \Qmail-archive.com\E |
+   \Qmailman.alsa-project.org/pipermail\E |
+   \Qmarc.info\E |
+   \Qozlabs.org/pipermail\E |
+   \Qspinics.net\E
+)};
+
 our @typeListMisordered = (
qr{char\s+(?:un)?signed},
qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3101,6 +3112,12 @@ sub process {
}
}
 
+   # Check for mailing list archives other than lore.kernel.org
+   if ($rawline =~ m{\b$obsolete_archives}) {
+   WARN("PREFER_LORE_ARCHIVE",
+"Use lore.kernel.org archive links when possible - 
see https://lore.kernel.org/lists.html\n; . $herecurr);
+   }
+
 # Check for added, moved or deleted files
if (!$reported_maintainer_file && !$in_commit_log &&
($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||




[PATCH] checkpatch: add warning for non-lore mailing list URLs

2020-12-17 Thread Bjorn Helgaas
From: Bjorn Helgaas 

The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
as lore.kernel.org because they use different styles, add advertising, and
may disappear in the future.  The lore archives are more consistent and
more likely to stick around, so prefer https://lore.kernel.org URLs when
they exist.

Signed-off-by: Bjorn Helgaas 
---
Sample commits for testing with "checkpatch -g":

  bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
  fdec2a9ef853 www.spinics.net/lists/kvm-arm
  1cdca16c043a www.spinics.net/lists/linux-mmc
  48ea02184a9d www.spinics.net/lists/linux-pci
  f32ae8a5f131 www.spinics.net/lists/netdev
  b7dca6dd1e59 lkml.org
  265df32eae58 lkml.org/lkml/
  4a9ceb7dbadf marc.info/?l=linux-kernel=155656897409107=2.
  c03914b7aa31 marc.info/?l=linux-mm
  f108c887d089 marc.info/?l=linux-netdev
  7424edbb5590 marc.info/?t=15620097564=1=2
  dabac6e460ce https://marc.info/?l=linux-rdma=152296522708522=2
  b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
  5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
  3cde818cd02b 
mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
  a5448fdc469d 
http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html
---
 scripts/checkpatch.pl | 17 +
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 00085308ed9d..ac8e99285b2a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -564,6 +564,17 @@ sub find_standard_signature {
return "";
 }
 
+our $obsolete_archives = qr{(?xi:
+   freedesktop.org/archives/dri-devel|
+   lists.infradead.org|
+   lkml.org|
+   mail-archive.com|
+   mailman.alsa-project.org/pipermail|
+   marc.info|
+   ozlabs.org/pipermail|
+   spinics.net
+)};
+
 our @typeListMisordered = (
qr{char\s+(?:un)?signed},
qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3101,6 +3112,12 @@ sub process {
}
}
 
+# Check for mailing list archives other than lore.kernel.org
+   if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {
+   WARN("PREFER_LORE_ARCHIVE",
+"Use lore.kernel.org archive links when possible; 
see https://lore.kernel.org/lists.html\n; . $herecurr);
+   }
+
 # Check for added, moved or deleted files
if (!$reported_maintainer_file && !$in_commit_log &&
($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
-- 
2.25.1