Bugzilla – Attachment 163593 Details for
Bug 36374
Some of our JS files should stay tidy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36374: Ensure js/modals/*.js files are tidy
Bug-36374-Ensure-jsmodalsjs-files-are-tidy.patch (text/plain), 1.78 KB, created by
Martin Renvoize (ashimema)
on 2024-03-21 09:34:55 UTC
(
hide
)
Description:
Bug 36374: Ensure js/modals/*.js files are tidy
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-03-21 09:34:55 UTC
Size:
1.78 KB
patch
obsolete
>From 274062bfa3883d7e8fbb3554113ea10593b458c4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 20 Mar 2024 16:18:14 +0000 >Subject: [PATCH] Bug 36374: Ensure js/modals/*.js files are tidy > >--- > xt/js_tidy.t | 38 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > create mode 100755 xt/js_tidy.t > >diff --git a/xt/js_tidy.t b/xt/js_tidy.t >new file mode 100755 >index 00000000000..d9a4555279b >--- /dev/null >+++ b/xt/js_tidy.t >@@ -0,0 +1,38 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use File::Slurp qw( read_file ); >+use File::Find; >+use FindBin(); >+use Data::Dumper qw( Dumper ); >+use Test::More tests => 1; >+ >+my @js_files; >+push @js_files, `git ls-files 'koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js'`; >+ >+my @not_tidy; >+foreach my $filepath (@js_files) { >+ chomp $filepath; >+ my $tidy = qx{yarn --silent run prettier --trailing-comma es5 --arrow-parens avoid $filepath}; >+ my $content = read_file $filepath; >+ if ( $content ne $tidy ) { >+ push @not_tidy, $filepath; >+ } >+} >+ >+is(scalar(@not_tidy), 0, 'No .js file should be messy') or diag Dumper \@not_tidy; >-- >2.44.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 36374
:
163555
|
163556
|
163558
|
163559
|
163560
|
163587
|
163588
|
163589
|
163591
|
163592
|
163593
|
163594
|
163595
|
163596
|
165732
|
165733
|
165734
|
165735
|
165736
|
165737
|
165738
|
165739
|
165740
|
165741
|
165742
|
165743