Quellcode durchsuchen

perl: Use correct comparison operator for each type

Fixes ValuesAndExpressions::ProhibitMismatchedOperators.

Warned-by: perlcritic
Guillem Jover vor 13 Jahren
Ursprung
Commit
e40e07a583
3 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 1 1
      dselect/methods/ftp/update
  2. 1 1
      scripts/Dpkg/Source/Package/V3/quilt.pm
  3. 1 0
      test/100_critic.t

+ 1 - 1
dselect/methods/ftp/update

@@ -39,7 +39,7 @@ if ($option eq 'manual') {
 	print 'Enter package file name:';
 	my $fn = <STDIN>;
 	chomp $fn;
-	if ($fn == '') {
+	if ($fn eq '') {
 	    exit 0;
 	}
 	if ( -f $fn ) {

+ 1 - 1
scripts/Dpkg/Source/Package/V3/quilt.pm

@@ -71,7 +71,7 @@ sub build_quilt_object {
 sub can_build {
     my ($self, $dir) = @_;
     my ($code, $msg) = $self->SUPER::can_build($dir);
-    return ($code, $msg) if $code eq 0;
+    return ($code, $msg) if $code == 0;
     my $quilt = $self->build_quilt_object($dir);
     $msg = $quilt->find_problems();
     return (0, $msg) if $msg;

+ 1 - 0
test/100_critic.t

@@ -77,6 +77,7 @@ my @policies = qw(
     ValuesAndExpressions::ProhibitComplexVersion
     ValuesAndExpressions::ProhibitInterpolationOfLiterals
     ValuesAndExpressions::ProhibitLongChainsOfMethodCalls
+    ValuesAndExpressions::ProhibitMismatchedOperators
     ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters
     ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator
     ValuesAndExpressions::ProhibitVersionStrings