Files
perl-B-Lint/fix-bare.diff

148 lines
5.3 KiB
Diff

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/B-Lint-1.20/Changes new/B-Lint-1.22/Changes
--- old/B-Lint-1.20/Changes 2014-10-26 21:00:05.000000000 +0100
+++ new/B-Lint-1.22/Changes 2017-11-13 17:36:52.000000000 +0100
@@ -1,5 +1,11 @@
Revision history for B-Lint
+1.22 2017-11-13 rurban
+ - fix wrong return @array scalar context warning (Closes RT#97873)
+
+1.21 2017-11-13 rurban
+ - skip $hash{bare} as BARE word test since 5.22 (Closes RT#101115)
+
1.20 2014-10-26
- install to archlib, as was done in 1.17 and previous, to avoid being
skipped over because of and older install appearing first in @INC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/B-Lint-1.20/lib/B/Lint.pm new/B-Lint-1.22/lib/B/Lint.pm
--- old/B-Lint-1.20/lib/B/Lint.pm 2014-10-26 21:00:14.000000000 +0100
+++ new/B-Lint-1.22/lib/B/Lint.pm 2017-11-13 17:35:48.000000000 +0100
@@ -1,7 +1,7 @@
package B::Lint;
use if $] > 5.017, 'deprecate';
-our $VERSION = '1.20'; ## no critic
+our $VERSION = '1.22'; ## no critic
=head1 NAME
@@ -85,6 +85,10 @@
Neither of these will do what a naive user would expect.
+Notice: Perl 5.22.0 does not report C<foo> in C<$b{foo}> as BARE token
+anymore. Therefore L<B::Lint> test is not reliable here. See
+L<CPAN RT#101115|https://rt.cpan.org/Public/Bug/Display.html?id=101115>.
+
=item B<dollar-underscore>
This option warns whenever C<$_> is used either explicitly anywhere or
@@ -411,14 +415,16 @@
next if $implies_ok_context{$pname};
- # Three special cases to deal with: "foreach (@foo)", "delete
+ # Four special cases to deal with: "foreach (@foo)", "delete
# $a{$b}", and "exists $a{$b}" null out the parent so we have to
# check for a parent of pp_null and a grandparent of
- # pp_enteriter, pp_delete, pp_exists
+ # pp_enteriter, pp_delete, pp_exists.
+ # return @array is also wrong, return has always list context.
next
if $pname eq "null"
and $gparent->name =~ m/\A(?:delete|enteriter|exists)\z/xms;
+ next if $pname eq "return";
# our( @bar ); would also trigger this error so I exclude
# that.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/B-Lint-1.20/META.json new/B-Lint-1.22/META.json
--- old/B-Lint-1.20/META.json 2014-10-26 21:03:30.000000000 +0100
+++ new/B-Lint-1.22/META.json 2017-11-13 17:42:02.000000000 +0100
@@ -4,7 +4,7 @@
"Joshua ben Jore <jjore@cpan.org>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142690",
+ "generated_by" : "ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
@@ -38,5 +38,6 @@
}
},
"release_status" : "stable",
- "version" : "1.20"
+ "version" : "1.22",
+ "x_serialization_backend" : "JSON::PP version 2.27400_02"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/B-Lint-1.20/META.yml new/B-Lint-1.22/META.yml
--- old/B-Lint-1.20/META.yml 2014-10-26 21:03:30.000000000 +0100
+++ new/B-Lint-1.22/META.yml 2017-11-13 17:42:02.000000000 +0100
@@ -7,7 +7,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142690'
+generated_by: 'ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -20,4 +20,5 @@
requires:
Module::Pluggable: '0'
if: '0'
-version: '1.20'
+version: '1.22'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/B-Lint-1.20/t/lint.t new/B-Lint-1.22/t/lint.t
--- old/B-Lint-1.20/t/lint.t 2013-01-24 02:29:37.000000000 +0100
+++ new/B-Lint-1.22/t/lint.t 2017-11-13 17:40:46.000000000 +0100
@@ -14,7 +14,7 @@
use strict;
use warnings;
-plan tests => 29;
+plan tests => 31;
# Runs a separate perl interpreter with the appropriate lint options
# turned on
@@ -53,6 +53,8 @@
runlint 'context', 'exists $BAR{BAZ}', '';
+runlint 'context', 'sub foo{return @_}', ''; # return CPAN RT#97873
+
runlint 'implicit-read', '/foo/', <<'RESULT';
Implicit match on $_ at -e line 1
RESULT
@@ -116,13 +118,19 @@
runlint 'bare-subs', 'sub bare(){1};$x=bare', '';
-runlint 'bare-subs', 'sub bare(){1}; $x=[bare=>0]; $x=$y{bare}', <<'RESULT';
+runlint 'bare-subs', 'sub bare(){1}; $x=[bare=>0]', <<'RESULT';
Bare sub name 'bare' interpreted as string at -e line 1
+RESULT
+
+SKIP: {
+ skip 'Perl 5.22 stopped marking $hash{bare} as BARE word, CPAN RT#101115',
+ 1, if $] >= 5.022;
+ runlint 'bare-subs', 'sub bare(){1}; $x=$y{bare}', <<'RESULT';
Bare sub name 'bare' interpreted as string at -e line 1
RESULT
+}
{
-
# Check for backwards-compatible plugin support. This was where
# preloaded mdoules would register themselves with B::Lint.
my $res = runperl(
@@ -135,7 +143,6 @@
}
{
-
# Check for Module::Plugin support
my $res = runperl(
switches => [ '-It/pluglib', '-MO=Lint,none' ],