/usr/share/perl5/Code/TidyAll/t/Plugin/PerlCritic.pm is in libcode-tidyall-perl 0.20-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | package Code::TidyAll::t::Plugin::PerlCritic;
$Code::TidyAll::t::Plugin::PerlCritic::VERSION = '0.20';
use Code::TidyAll::Util qw(write_file);
use Test::Class::Most parent => 'Code::TidyAll::t::Plugin';
sub test_main : Tests {
my $self = shift;
my $rc_file = $self->{root_dir} . "/perlcriticrc";
write_file( $rc_file, "only = 1\nseverity = 1\n[TestingAndDebugging::RequireUseStrict]\n" );
$self->tidyall(
source => 'my $foo = 5\n',
conf => { argv => "--profile $rc_file" },
expect_error => qr/Code before strictures/,
);
$self->tidyall(
source => 'use strict;\nuse warnings;\nmy $foo = 5\n',
conf => { argv => "--profile $rc_file" },
expect_ok => 1,
);
write_file( $rc_file, "only = 1\nseverity = 1\n[CodeLayout::ProhibitHardTabs]\n" );
$self->tidyall(
source => 'my $foo = 5\n',
conf => { argv => "--profile $rc_file" },
expect_ok => 1,
);
$self->tidyall(
source => 'my $foo = 5\n',
conf => { argv => "--profile $rc_file --badoption" },
expect_error => qr/Unknown option: badoption/
);
write_file( $rc_file, "badconfig = 1\n" );
$self->tidyall(
source => 'my $foo = 5\n',
conf => { argv => "--profile $rc_file" },
expect_error => qr/"badconfig" is not a supported option/
);
}
1;
|