https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8414
Bug ID: 8414
Summary: Perlcritic warnings on Debian
Product: Spamassassin
Version: 4.0.3
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Libraries
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: Undefined
Created attachment 6078
--> https://bz.apache.org/SpamAssassin/attachment.cgi?id=6078&action=edit
Silence perlcritic.t on Debian
On Debian perlcritic.t test fails [¹] with
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/DnsResolver.pm"'
# at
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.40.4/bb7f/lib/site_perl/5.40.4/Test/Perl/Critic.pm
line 121.
#
# [ControlStructures::ProhibitBareBlockLoopControls] 'last' in "do" block at
line 948, near 'last;'. (Severity: 5)
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Check.pm"'
# at
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.40.4/bb7f/lib/site_perl/5.40.4/Test/Perl/Critic.pm
line 121.
#
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in "do" block at
line 391, near 'next;'. (Severity: 5)
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/HashBL.pm"'
# at
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.40.4/bb7f/lib/site_perl/5.40.4/Test/Perl/Critic.pm
line 121.
#
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 723, near 'next if ($uri =~ /^mailto:/i);'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 724, near 'next if $seen{$uri}++;'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 727, near 'next unless $info->{hosts};'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 728, near 'next unless $info->{cleaned};'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 729, near 'next unless $info->{types}->{a} || $info->{types}->{parsed};'.
(Severity: 5)
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/Plugin/Bayes.pm"'
# at
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.40.4/bb7f/lib/site_perl/5.40.4/Test/Perl/Critic.pm
line 121.
#
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 1283, near 'next if ( defined $magic_re && $token =~ /$magic_re/o );'.
(Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 1292, near 'next if $len < 3;'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 1307, near 'next if $self->{stopword_cache}{$token};'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 1337, near 'next;'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'next' in bare block at
line 1348, near 'next;'. (Severity: 5)
# Failed test 'Test::Perl::Critic for
"../blib/lib/Mail/SpamAssassin/BayesStore/DBM.pm"'
# at
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.40.4/bb7f/lib/site_perl/5.40.4/Test/Perl/Critic.pm
line 121.
#
# [ControlStructures::ProhibitBareBlockLoopControls] 'last' in "do" block at
line 1161, near 'last;'. (Severity: 5)
# [ControlStructures::ProhibitBareBlockLoopControls] 'last' in "do" block at
line 1173, near 'last;'. (Severity: 5)
t/perlcritic.t ....................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 5/151 subtests
Attached patch silence the warning, another option would be to rewrite those
loops.
[¹]
https://www.cpantesters.org/cpan/report/13131970-ad96-11f1-96af-b43c05fb7cba
--
You are receiving this mail because:
You are the assignee for the bug.