View | Details | Raw Unified | Return to bug 39876
Collapse All | Expand All

(-)a/Koha/Devel/Files.pm (-8 / +12 lines)
Lines 30-40 The module defines a set of exceptions for different file types and contexts. Th Link Here
30
=cut
30
=cut
31
31
32
my $exceptions = {
32
my $exceptions = {
33
    pl => [qw(Koha/Schema/Result Koha/Schema.pm)],
33
    pl => { tidy => [qw(Koha/Schema/Result Koha/Schema.pm)] },
34
    js => [
34
    js => {
35
        qw(koha-tmpl/intranet-tmpl/lib koha-tmpl/intranet-tmpl/js/Gettext.js koha-tmpl/opac-tmpl/lib Koha/ILL/Backend/)
35
        tidy => [
36
    ],
36
            qw(koha-tmpl/intranet-tmpl/lib koha-tmpl/intranet-tmpl/js/Gettext.js koha-tmpl/opac-tmpl/lib Koha/ILL/Backend/)
37
    tt => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)],
37
        ]
38
    },
39
    tt => { tidy => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)] },
38
};
40
};
39
41
40
=head1 METHODS
42
=head1 METHODS
Lines 50-57 Creates a new instance of Koha::Devel::Files. The constructor accepts a hash ref Link Here
50
=cut
52
=cut
51
53
52
sub new {
54
sub new {
53
    my ($class) = @_;
55
    my ( $class, $args ) = @_;
54
    my $self = {};
56
    my $self = { context => $args->{context} };
55
    bless $self, $class;
57
    bless $self, $class;
56
    return $self;
58
    return $self;
57
}
59
}
Lines 66-72 Builds a Git exclude pattern for a given file type based on the context provided Link Here
66
68
67
sub build_git_exclude {
69
sub build_git_exclude {
68
    my ( $self, $filetype ) = @_;
70
    my ( $self, $filetype ) = @_;
69
    return join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype} } ) );
71
    return $self->{context} && exists $exceptions->{$filetype}->{ $self->{context} }
72
        ? join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype}->{ $self->{context} } } ) )
73
        : q{};
70
}
74
}
71
75
72
=head2 ls_perl_files
76
=head2 ls_perl_files
(-)a/misc/devel/tidy.pl (-2 / +1 lines)
Lines 36-42 pod2usage("--no-write can only be passed with a single file") if $no_write && @f Link Here
36
pod2usage("--perl, --js and --tt can only be passed without any other files in parameter")
36
pod2usage("--perl, --js and --tt can only be passed without any other files in parameter")
37
    if @files && ( $perl_files || $js_files || $tt_files );
37
    if @files && ( $perl_files || $js_files || $tt_files );
38
38
39
my $dev_files = Koha::Devel::Files->new;
39
my $dev_files = Koha::Devel::Files->new( { context => 'tidy' } );
40
40
41
my @original_files = @files;
41
my @original_files = @files;
42
if (@files) {
42
if (@files) {
43
- 

Return to bug 39876