Bugzilla – Attachment 143775 Details for
Bug 32130
Vue files must be kept tidy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32130: Add a test to ensure vue files will be kept tidy
Bug-32130-Add-a-test-to-ensure-vue-files-will-be-k.patch (text/plain), 2.06 KB, created by
Martin Renvoize (ashimema)
on 2022-11-11 11:22:04 UTC
(
hide
)
Description:
Bug 32130: Add a test to ensure vue files will be kept tidy
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-11 11:22:04 UTC
Size:
2.06 KB
patch
obsolete
>From db0b282cd24f027a5d385e4be3cec3881bdb2b4f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 8 Nov 2022 07:16:04 +0100 >Subject: [PATCH] Bug 32130: Add a test to ensure vue files will be kept tidy > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > xt/vue_tidy.t | 45 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > create mode 100755 xt/vue_tidy.t > >diff --git a/xt/vue_tidy.t b/xt/vue_tidy.t >new file mode 100755 >index 0000000000..122aea1f50 >--- /dev/null >+++ b/xt/vue_tidy.t >@@ -0,0 +1,45 @@ >+#!/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 $vue_dir = "$FindBin::Bin/../koha-tmpl/intranet-tmpl/prog/js/vue"; >+ >+my @files; >+sub wanted { >+ my $name = $File::Find::name; >+ push @files, $name >+ if $name =~ /\.vue$/; >+} >+find({ wanted => \&wanted, no_chdir => 1 }, $vue_dir); >+ >+my @not_tidy; >+foreach my $filepath (@files) { >+ chomp $filepath; >+ my $tidy = qx{yarn --silent run prettier --trailing-comma es5 --semi false --arrow-parens avoid $filepath}; >+ my $content = read_file $filepath; >+ if ( $content ne $tidy ) { >+ push @not_tidy, $filepath; >+ } >+} >+ >+is(scalar(@not_tidy), 0, 'No vue file should be messy') or diag Dumper \@not_tidy; >-- >2.20.1
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 32130
:
143385
|
143387
|
143613
| 143775