Skip to content

Commit

Permalink
Treat use v5.36 as use_warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
charsbar committed Sep 9, 2023
1 parent 6add9b9 commit e92218d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Module/CPANTS/Kwalitee/Uses.pm
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ sub kwalitee_indicators {
my $d = shift;
my $files = $d->{files_hash} || {};

my $perl_version_with_implicit_use_warnings = version->new('5.036')->numify;
my @no_warnings;
for my $file (keys %$files) {
next unless exists $files->{$file}{module};
Expand All @@ -237,6 +238,11 @@ sub kwalitee_indicators {
next if $file =~ /\.pod$/;
my $module = $files->{$file}{module};
my $requires = $files->{$file}{requires} || {};
my $required_perl = $requires->{perl};
if (defined $required_perl) {
$required_perl =~ s/_//; # tweak 5.008_001 and the likes for silence
next if version->parse($required_perl)->numify >= $perl_version_with_implicit_use_warnings;
}
push @no_warnings, $module if none {exists $requires->{$_}} (@WARNINGS_EQUIV, @STRICT_WARNINGS_EQUIV);
}
if (@no_warnings) {
Expand Down
3 changes: 3 additions & 0 deletions xt/kwalitee/use_warnings.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ xt::kwalitee::Test::run(

# v6 module inside a Perl 5 distribution
['NINE/Inline-Perl6-0.07.tar.gz', 1],

# v5.36.0
['GUGOD/PerlX-ScopeFunction-0.03.tar.gz', 1],
);

0 comments on commit e92218d

Please sign in to comment.