Skip to content

Commit 650cbdf

Browse files
committed
Change definition of APPDIR
1 parent fde58b0 commit 650cbdf

File tree

9 files changed

+26
-14
lines changed

9 files changed

+26
-14
lines changed

.perlcriticrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ verbose = 11
1111
[-RegularExpressions::RequireExtendedFormatting]
1212
[-RegularExpressions::RequireLineBoundaryMatching]
1313
[-Subroutines::ProhibitExplicitReturnUndef]
14+
[-Subroutines::ProhibitSubroutinePrototypes]
1415
[-ValuesAndExpressions::ProhibitNoisyQuotes]
1516
[-ValuesAndExpressions::ProhibitAccessOfPrivateData]
1617
[-Variables::ProhibitPunctuationVars]
1718

1819
[CodeLayout::RequireTrailingCommas]
1920
severity = 4
2021

22+
# Don't use function prototypes
23+
[Community::Prototypes]
24+
severity = 4
25+
signature_enablers = cPstrict GrepCpan::std
26+
2127
[TestingAndDebugging::RequireUseStrict]
2228
equivalent_modules = MetaCPAN::Moose Mojo::Base Test::Routine
2329

.tidyallrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ select = bin/app.psgi
55
select = cpanfile
66
ignore = t/var/**/*
77
ignore = .gitignore
8+
ignore = cpanfile
89
argv = --profile=$ROOT/.perltidyrc
910

1011
[PerlCritic]

cpanfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ on 'develop' => sub {
4141
recommends 'Devel::NYTProf';
4242
recommends "Code::TidyAll::Git::Precommit";
4343
recommends "Code::TidyAll::Plugin::UniqueLines";
44+
recommends "Perl::Critic::Policy::Documentation::RequirePodLinksIncludeText";
4445
recommends "Perl::Critic::Nits";
46+
recommends "Perl::Critic::Policy::Community::Prototypes";
4547
};
4648

environments/development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ startup_info: 1
2525
grepcpan:
2626
nocache: 0
2727
maxworkers: 2
28-
gitrepo: '~APPDIR~/../../metacpan-cpan-extracted-lite'
28+
gitrepo: '~APPDIR~/../metacpan-cpan-extracted-lite'
2929
#gitrepo: '/shared/metacpan_git'
3030
binaries:
3131
git: '/opt/homebrew/bin/git' # for macOS

environments/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ startup_info: 1
2525
grepcpan:
2626
nocache: 0
2727
maxworkers: 2
28-
gitrepo: '~APPDIR~/../../metacpan-cpan-extracted-lite'
28+
gitrepo: '~APPDIR~/../metacpan-cpan-extracted-lite'
2929
# binaries:
3030
# git: '/usr/local/cpanel/3rdparty/bin/git'
3131
cache:

lib/GrepCpan/Grep.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ sub cache_cleanup { # aka tmpwatch
188188
return;
189189
}
190190

191-
sub massage_path {
192-
my ( $self, $s ) = @_;
191+
sub massage_path ( $self, $s ) {
193192

194193
return unless defined $s;
194+
195195
my $appdir = $self->root;
196+
$appdir =~ s{/(?:bin|t)/?$}{};
197+
196198
$s =~ s{~APPDIR~}{$appdir}g;
197199

198200
return $s;

t/GrepCpan-Grep-dosearch.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ my $config = {
5050
'history_size' => '20'
5151
},
5252
'demo' => '0',
53-
'gitrepo' => '~APPDIR~/../../metacpan-cpan-extracted-lite',
53+
'gitrepo' => '~APPDIR~/../metacpan-cpan-extracted-lite',
5454
'limit' => {
5555
'distros_per_page' => '30',
5656
'files_git_run_bg' => '2000',

t/GrepCpan-Grep-workers.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ use GrepCpan::Grep;
1212

1313
use File::Temp ();
1414

15-
my $tmp = File::Temp->newdir( "grep-XXXXXX", DIR => q[/tmp], UNLINK => 1 );
15+
my $tmp = File::Temp->newdir( "grep-XXXXXX", DIR => q[/tmp], UNLINK => 1 );
1616
my $tmpdir = $tmp->dirname;
1717
ok -d $tmpdir, "using tmp directory: $tmpdir";
1818

1919
my $config = {
2020
'maxworkers' => '2',
21-
'gitrepo' => '~APPDIR~/../../metacpan-cpan-extracted-lite',
21+
'gitrepo' => '~APPDIR~/../metacpan-cpan-extracted-lite',
2222
'cache' => {
2323
'directory' => $tmpdir,
2424
'version' => "0.$$"
@@ -59,7 +59,7 @@ my $fork_a_worker = sub {
5959
# the worker is working....
6060
while ( kill USR2 => $mainpid )
6161
{ # run until as long as our parent is running
62-
#note "sending USR2 from $$";
62+
#note "sending USR2 from $$";
6363
sleep 1;
6464
}
6565
exit;
@@ -75,7 +75,7 @@ is $grep->check_if_a_worker_is_available(), undef,
7575

7676
kill 'KILL' => $kids[0];
7777
ok waitpid( $kids[0], 0 ), 'one worker finished';
78-
ok $fork_a_worker->(), 'can fork an extra worker';
78+
ok $fork_a_worker->(), 'can fork an extra worker';
7979
is $grep->check_if_a_worker_is_available(), undef,
8080
"queue is full: cannot start an extra worker";
8181

t/GrepCpan-Grep.t

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ my $test_methods = {
2323
my $config = {
2424
'binaries' => { 'git' => '/home/atoomic/bin/git' },
2525
'cache' => {
26-
'directory' => '~APPDIR~/../var/tmp',
26+
'directory' => '~APPDIR~/var/tmp',
2727
'version' => '1.03'
2828
},
2929
'cookie' => {
3030
'history_name' => 'lastsearch',
3131
'history_size' => '20'
3232
},
3333
'demo' => '0',
34-
'gitrepo' => '~APPDIR~/../../metacpan-cpan-extracted-lite',
34+
'gitrepo' => '~APPDIR~/../metacpan-cpan-extracted-lite',
3535
'limit' => {
3636
'distros_per_page' => '30',
3737
'files_git_run_bg' => '2000',
@@ -48,7 +48,7 @@ my $config = {
4848
}
4949
};
5050

51-
$grepcpan::VERSION = '1.00_01'; # devel version
51+
$grepcpan::VERSION = '1.00_01'; # devel version
5252

5353
my $grep = GrepCpan::Grep->new( config => $config );
5454
isa_ok $grep, 'GrepCpan::Grep';
@@ -80,13 +80,14 @@ like $grep->current_version,
8080
[ 'distros/e', 'eBay-API', 'eg/XML/getSearchResults.pl' ],
8181
'distros/f/failures/lib/failures.pm' =>
8282
[ 'distros/f', 'failures', 'lib/failures.pm' ],
83-
'distros/f/fewer/Changes' => [ 'distros/f', 'fewer', 'Changes' ],
83+
'distros/f/fewer/Changes' => [ 'distros/f', 'fewer', 'Changes' ],
8484
'distros/s/snapcast/LICENSE' =>
8585
[ 'distros/s', 'snapcast', 'LICENSE' ],
8686
};
8787

8888
foreach my $input ( sort keys %$valid_input ) {
89-
is [ GrepCpan::Grep::massage_filepath($input) ] => $valid_input->{$input},
89+
is [ GrepCpan::Grep::massage_filepath($input) ] =>
90+
$valid_input->{$input},
9091
"massage_filepath($input)";
9192
}
9293

0 commit comments

Comments
 (0)