Bugzilla – Attachment 151331 Details for
Bug 33625
Enforce formatting on vue .js and .ts files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33625: Adjust test to deal with cypress tests
Bug-33625-Adjust-test-to-deal-with-cypress-tests.patch (text/plain), 2.14 KB, created by
Jonathan Druart
on 2023-05-17 12:25:43 UTC
(
hide
)
Description:
Bug 33625: Adjust test to deal with cypress tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-05-17 12:25:43 UTC
Size:
2.14 KB
patch
obsolete
>From 1ed532c2208ec19248461bdf0f726895cf6fb14d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 17 May 2023 14:23:13 +0200 >Subject: [PATCH] Bug 33625: Adjust test to deal with cypress tests > >Cypress test files were ignored. >This patch also deals with files in git index only. >--- > xt/vue_tidy.t | 28 ++++++++-------------------- > 1 file changed, 8 insertions(+), 20 deletions(-) > >diff --git a/xt/vue_tidy.t b/xt/vue_tidy.t >index 7052e6f8828..5c1545b5cf5 100755 >--- a/xt/vue_tidy.t >+++ b/xt/vue_tidy.t >@@ -22,18 +22,16 @@ use FindBin(); > use Data::Dumper qw( Dumper ); > use Test::More tests => 2; > >-my $vue_dir = "$FindBin::Bin/../koha-tmpl/intranet-tmpl/prog/js/vue"; >+my @vue_files; >+push @vue_files, `git ls-files 'koha-tmpl/intranet-tmpl/prog/js/vue/*.vue'`; >+my @js_files; >+push @js_files, `git ls-files 'koha-tmpl/intranet-tmpl/prog/js/vue/*.js'`; >+push @js_files, `git ls-files 'koha-tmpl/intranet-tmpl/prog/js/vue/*.ts'`; >+push @js_files, `git ls-files 't/cypress/integration/*.ts'`; > >-my @files; >-sub wanted_vue { >- my $name = $File::Find::name; >- push @files, $name >- if $name =~ /\.vue$/; >-} >-find({ wanted => \&wanted_vue, no_chdir => 1 }, $vue_dir); > > my @not_tidy; >-foreach my $filepath (@files) { >+foreach my $filepath (@vue_files) { > chomp $filepath; > my $tidy = qx{yarn --silent run prettier --trailing-comma es5 --semi false --arrow-parens avoid $filepath}; > my $content = read_file $filepath; >@@ -44,18 +42,8 @@ foreach my $filepath (@files) { > > is(scalar(@not_tidy), 0, 'No .vue file should be messy') or diag Dumper \@not_tidy; > >-@files = (); >-sub wanted_js_ts { >- my $name = $File::Find::name; >- push @files, $name >- if ( $name =~ /\.js$/ >- || $name =~ /\.ts$/ ) >- && $name !~ m{koha-tmpl/intranet-tmpl/prog/js/vue/dist}; # Exclude dist >-} >-find({ wanted => \&wanted_js_ts, no_chdir => 1 }, $vue_dir); >- > @not_tidy = (); >-foreach my $filepath (@files) { >+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; >-- >2.25.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 33625
:
150508
|
150509
|
150513
|
150514
| 151331 |
151332