Bugzilla – Attachment 183619 Details for
Bug 39876
Centralize listing of files from our codebase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39876: Add context for tidy
Bug-39876-Add-context-for-tidy.patch (text/plain), 2.70 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-06-27 17:28:16 UTC
(
hide
)
Description:
Bug 39876: Add context for tidy
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-06-27 17:28:16 UTC
Size:
2.70 KB
patch
obsolete
>From 67d9c0703d3e6bf67459ce2ba44d00f135fb9b82 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 12 May 2025 12:35:43 +0200 >Subject: [PATCH] Bug 39876: Add context for tidy > >With this patch we adjust what's needed to make misc/devel/tidy.pl run >identically as before > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Devel/Files.pm | 20 ++++++++++++-------- > misc/devel/tidy.pl | 2 +- > 2 files changed, 13 insertions(+), 9 deletions(-) > >diff --git a/Koha/Devel/Files.pm b/Koha/Devel/Files.pm >index 00a721a98b1..fb339ef839f 100644 >--- a/Koha/Devel/Files.pm >+++ b/Koha/Devel/Files.pm >@@ -30,11 +30,13 @@ The module defines a set of exceptions for different file types and contexts. Th > =cut > > my $exceptions = { >- pl => [qw(Koha/Schema/Result Koha/Schema.pm)], >- js => [ >- qw(koha-tmpl/intranet-tmpl/lib koha-tmpl/intranet-tmpl/js/Gettext.js koha-tmpl/opac-tmpl/lib Koha/ILL/Backend/) >- ], >- tt => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)], >+ pl => { tidy => [qw(Koha/Schema/Result Koha/Schema.pm)] }, >+ js => { >+ tidy => [ >+ qw(koha-tmpl/intranet-tmpl/lib koha-tmpl/intranet-tmpl/js/Gettext.js koha-tmpl/opac-tmpl/lib Koha/ILL/Backend/) >+ ] >+ }, >+ tt => { tidy => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)] }, > }; > > =head1 METHODS >@@ -50,8 +52,8 @@ Creates a new instance of Koha::Devel::Files. The constructor accepts a hash ref > =cut > > sub new { >- my ($class) = @_; >- my $self = {}; >+ my ( $class, $args ) = @_; >+ my $self = { context => $args->{context} }; > bless $self, $class; > return $self; > } >@@ -66,7 +68,9 @@ Builds a Git exclude pattern for a given file type based on the context provided > > sub build_git_exclude { > my ( $self, $filetype ) = @_; >- return join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype} } ) ); >+ return $self->{context} && exists $exceptions->{$filetype}->{ $self->{context} } >+ ? join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype}->{ $self->{context} } } ) ) >+ : q{}; > } > > =head2 ls_perl_files >diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl >index ff338528ff5..f8829044eec 100755 >--- a/misc/devel/tidy.pl >+++ b/misc/devel/tidy.pl >@@ -36,7 +36,7 @@ pod2usage("--no-write can only be passed with a single file") if $no_write && @f > pod2usage("--perl, --js and --tt can only be passed without any other files in parameter") > if @files && ( $perl_files || $js_files || $tt_files ); > >-my $dev_files = Koha::Devel::Files->new; >+my $dev_files = Koha::Devel::Files->new( { context => 'tidy' } ); > > my @original_files = @files; > if (@files) { >-- >2.50.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39876
:
182305
|
182306
|
182307
|
182344
|
182345
|
182346
|
182354
|
182380
|
182381
|
182382
|
182417
|
182461
|
183618
| 183619 |
183620
|
183621
|
183622
|
183623
|
183625