/usr/share/perl5/Module/Starter/Plugin/CGIApp/templates/titanium/boilerplate.t is in libmodule-starter-plugin-cgiapp-perl 0.30-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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/usr/bin/perl
# Some tests to make sure you are not using default placeholders from the
# templates. Remove this file after you have customized the distribution.
use strict;
use warnings;
use English qw( -no_match_vars );
use Test::More tests => 4 + <tmpl_var nummodules>;
sub not_in_file_ok {
my ( $filename, %regex ) = @_;
open my $fh, '<', $filename
or die "couldn't open $filename for reading: $ERRNO";
my %violated;
while ( my $line = <$fh> ) {
while ( my ( $desc, $regex ) = each %regex ) {
if ( $line =~ $regex ) {
push @{ $violated{$desc} ||= [] }, $NR;
}
}
}
close $fh or die "Close failed: $ERRNO";
if (%violated) {
fail("$filename contains boilerplate text");
for ( keys %violated ) {
diag "$_ appears on lines @{$violated{$_}}";
}
}
else {
pass("$filename contains no boilerplate text");
}
return;
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok(
$module => 'the great new $MODULENAME' => qr/\Q - The great new \E/msx,
'boilerplate description' => qr/\QQuick summary of what the module\E/msx,
'stub function definition' => qr/function[12]/msx,
);
return;
}
not_in_file_ok(
'<tmpl_var buildscript>' => 'Abstract' => qr/\QAbstract goes here.\E/msx,
);
not_in_file_ok(
LICENSE => 'License terms' => qr/\QInsert license text here.\E/msx,
);
not_in_file_ok(
README => 'The README is used...' => qr/\QThe README is used\E/msx,
"'version information here'" => qr/\Qto provide version information\E/msx,
);
not_in_file_ok( Changes => 'placeholder date/time' => qr{Date/time}msx );
<tmpl_loop module_pm_files>
module_boilerplate_ok('<tmpl_var module_pm_files_item>');
</tmpl_loop>
|