Re: [PATCH 5/4] get_maintainer: shut up perl critic

2014-05-27 Thread Stephen Hemminger
On Mon, 26 May 2014 18:32:36 -0700
Joe Perches  wrote:

> On Mon, 2014-05-26 at 18:22 -0700, Stephen Hemminger wrote:
> > Use the no critic annotation, with comment, to silence perl critic
> > for places where the code is correct as is.
> 
> I think this uglifies the code and a more sensible solution
> is not using perlcritic
> 
> 

Perlcritic like checkpatch or sparse is a useful tool but often generates
false positives. Doing this allows shutting up the tool.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/4] get_maintainer: shut up perl critic

2014-05-27 Thread Stephen Hemminger
On Mon, 26 May 2014 18:32:36 -0700
Joe Perches j...@perches.com wrote:

 On Mon, 2014-05-26 at 18:22 -0700, Stephen Hemminger wrote:
  Use the no critic annotation, with comment, to silence perl critic
  for places where the code is correct as is.
 
 I think this uglifies the code and a more sensible solution
 is not using perlcritic
 
 

Perlcritic like checkpatch or sparse is a useful tool but often generates
false positives. Doing this allows shutting up the tool.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/4] get_maintainer: shut up perl critic

2014-05-26 Thread Joe Perches
On Mon, 2014-05-26 at 18:22 -0700, Stephen Hemminger wrote:
> Use the no critic annotation, with comment, to silence perl critic
> for places where the code is correct as is.

I think this uglifies the code and a more sensible solution
is not using perlcritic


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/4] get_maintainer: shut up perl critic

2014-05-26 Thread Stephen Hemminger
Use the no critic annotation, with comment, to silence perl critic
for places where the code is correct as is.

Signed-off-by: Stephen Hemminger 

---

Supersedes patch 1

--- a/scripts/get_maintainer.pl 2014-05-26 18:09:38.257783683 -0700
+++ b/scripts/get_maintainer.pl 2014-05-26 18:19:25.782478516 -0700
@@ -231,7 +231,10 @@ if ($version != 0) {
 exit 0;
 }
 
+# For this usage requiring IO::Interactive is overkill
+## no critic (ProhibitInteractiveTest)
 if (-t STDIN && !@ARGV) {
+## use critic
 # We're talking to a terminal, but have no command line arguments.
 die "$P: missing patchfile or -f file - use --help if necessary\n";
 }
@@ -423,8 +426,13 @@ foreach my $file (@ARGV) {
my $file_cnt = @files;
my $lastfile;
 
+   # Use two argument form of open because we want
+   # to allow using "-" to indicate standard input
+
+   ## no critic (ProhibitTwoArgOpen)
open(my $patch, "< $file")
or die "$P: Can't open $file: $!\n";
+   ## use critic
 
# We can check arbitrary information before the patch
# like the commit message, mail headers, etc...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/4] get_maintainer: shut up perl critic

2014-05-26 Thread Stephen Hemminger
Use the no critic annotation, with comment, to silence perl critic
for places where the code is correct as is.

Signed-off-by: Stephen Hemminger step...@networkplumber.org

---

Supersedes patch 1

--- a/scripts/get_maintainer.pl 2014-05-26 18:09:38.257783683 -0700
+++ b/scripts/get_maintainer.pl 2014-05-26 18:19:25.782478516 -0700
@@ -231,7 +231,10 @@ if ($version != 0) {
 exit 0;
 }
 
+# For this usage requiring IO::Interactive is overkill
+## no critic (ProhibitInteractiveTest)
 if (-t STDIN  !@ARGV) {
+## use critic
 # We're talking to a terminal, but have no command line arguments.
 die $P: missing patchfile or -f file - use --help if necessary\n;
 }
@@ -423,8 +426,13 @@ foreach my $file (@ARGV) {
my $file_cnt = @files;
my $lastfile;
 
+   # Use two argument form of open because we want
+   # to allow using - to indicate standard input
+
+   ## no critic (ProhibitTwoArgOpen)
open(my $patch,  $file)
or die $P: Can't open $file: $!\n;
+   ## use critic
 
# We can check arbitrary information before the patch
# like the commit message, mail headers, etc...
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/4] get_maintainer: shut up perl critic

2014-05-26 Thread Joe Perches
On Mon, 2014-05-26 at 18:22 -0700, Stephen Hemminger wrote:
 Use the no critic annotation, with comment, to silence perl critic
 for places where the code is correct as is.

I think this uglifies the code and a more sensible solution
is not using perlcritic


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/