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

(-)a/Koha/Devel/Files.pm (-8 / +12 lines)
Lines 29-39 The module defines a set of exceptions for different file types and contexts. Th Link Here
29
=cut
29
=cut
30
30
31
my $exceptions = {
31
my $exceptions = {
32
    pl => [qw(Koha/Schema/Result Koha/Schema.pm)],
32
    pl => { tidy => [qw(Koha/Schema/Result Koha/Schema.pm)] },
33
    js => [
33
    js => {
34
        qw(koha-tmpl/intranet-tmpl/lib koha-tmpl/intranet-tmpl/js/Gettext.js koha-tmpl/opac-tmpl/lib Koha/ILL/Backend/)
34
        tidy => [
35
    ],
35
            qw(koha-tmpl/intranet-tmpl/lib koha-tmpl/intranet-tmpl/js/Gettext.js koha-tmpl/opac-tmpl/lib Koha/ILL/Backend/)
36
    tt => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)],
36
        ]
37
    },
38
    tt => { tidy => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)] },
37
};
39
};
38
40
39
=head1 METHODS
41
=head1 METHODS
Lines 49-56 Creates a new instance of Koha::Devel::Files. The constructor accepts a hash ref Link Here
49
=cut
51
=cut
50
52
51
sub new {
53
sub new {
52
    my ($class) = @_;
54
    my ( $class, $args ) = @_;
53
    my $self = {};
55
    my $self = { context => $args->{context} };
54
    bless $self, $class;
56
    bless $self, $class;
55
    return $self;
57
    return $self;
56
}
58
}
Lines 65-71 Builds a Git exclude pattern for a given file type based on the context provided Link Here
65
67
66
sub build_git_exclude {
68
sub build_git_exclude {
67
    my ( $self, $filetype ) = @_;
69
    my ( $self, $filetype ) = @_;
68
    return join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype} } ) );
70
    return $self->{context} && exists $exceptions->{$filetype}->{ $self->{context} }
71
        ? join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype}->{ $self->{context} } } ) )
72
        : q{};
69
}
73
}
70
74
71
=head2 ls_perl_files
75
=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