Bug 38664: Remove 'keep tidy' for JS files
We now want to check (almost) all JS files On the tidy branch: xt/js_tidy.t .. ok All tests successful. Files=1, Tests=175, 129 wallclock secs ( 0.07 usr 0.01 sys + 103.69 cusr 37.68 csys = 141.45 CPU) Result: PASS real 2m8.187s user 1m43.806s sys 0m37.730s xt/vue_tidy.t .. ok All tests successful. Files=1, Tests=75, 60 wallclock secs ( 0.04 usr 0.01 sys + 53.80 cusr 17.22 csys = 71.07 CPU) Result: PASS real 1m0.137s user 0m53.891s sys 0m17.286s Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
b9affd17cf
commit
9fe7434eaa
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import ArticleRequestAPIClient from "./article-request-api-client.js";
|
||||
import AVAPIClient from "./authorised-value-api-client.js";
|
||||
import CataloguingAPIClient from "./cataloguing-api-client.js";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class ArticleRequestAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class AVAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class CataloguingAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class CirculationAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class ClubAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class CoverImageAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
class Dialog {
|
||||
constructor(options = {}) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class LocalizationAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class PatronAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class RecallAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class SysprefAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
import HttpClient from "./http-client.js";
|
||||
|
||||
export class TicketAPIClient extends HttpClient {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
$(document).ready(function () {
|
||||
$("body").on("click", ".submit-form-link", function (e) {
|
||||
e.preventDefault();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
$(document).ready(function () {
|
||||
// Pre-populate empty message with template
|
||||
$("#addConcernModal").on("show.bs.modal", function (e) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
$(document).ready(function () {
|
||||
document.addEventListener("click", function (event) {
|
||||
const detailTrigger = event.target.closest(".detail-trigger");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
let dataFetched = false;
|
||||
let bookable_items,
|
||||
bookings,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
/* global KOHA CodeMirror to_highlight search_jumped humanMsg dataTablesDefaults themelang */
|
||||
// We can assume 'KOHA' exists, as we depend on KOHA.AJAX
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* keep tidy */
|
||||
// Bookings
|
||||
var bookings_table;
|
||||
$(document).ready(function () {
|
||||
|
|
|
|||
19
xt/js_tidy.t
19
xt/js_tidy.t
|
|
@ -17,23 +17,16 @@
|
|||
|
||||
use Modern::Perl;
|
||||
use File::Slurp qw( read_file );
|
||||
use File::Find;
|
||||
use FindBin();
|
||||
use Data::Dumper qw( Dumper );
|
||||
use Test::More tests => 1;
|
||||
use Test::More;
|
||||
|
||||
my $cmd = q{git grep -l '/\* keep tidy \*/' -- '*.js'};
|
||||
my @js_files = qx{$cmd};
|
||||
my @js_files =
|
||||
qx{git ls-files '*.js' '*.ts' ':(exclude)koha-tmpl/intranet-tmpl/lib' ':(exclude)koha-tmpl/intranet-tmpl/js/Gettext.js' ':(exclude)koha-tmpl/opac-tmpl/lib' ':(exclude)Koha/ILL/Backend/'};
|
||||
|
||||
plan tests => scalar @js_files;
|
||||
|
||||
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;
|
||||
}
|
||||
ok( $content eq $tidy, "$filepath should be kept tidy" );
|
||||
}
|
||||
|
||||
is( scalar(@not_tidy), 0, sprintf( 'No .js file should be messy %s/%s', scalar(@not_tidy), scalar(@js_files) ) )
|
||||
or diag Dumper \@not_tidy;
|
||||
|
|
|
|||
|
|
@ -17,39 +17,15 @@
|
|||
|
||||
use Modern::Perl;
|
||||
use File::Slurp qw( read_file );
|
||||
use File::Find;
|
||||
use FindBin();
|
||||
use Data::Dumper qw( Dumper );
|
||||
use Test::More tests => 2;
|
||||
use Test::More;
|
||||
|
||||
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 @vue_files = `git ls-files 'koha-tmpl/intranet-tmpl/prog/js/vue/*.vue'`;
|
||||
|
||||
plan tests => scalar @vue_files;
|
||||
|
||||
my @not_tidy;
|
||||
foreach my $filepath (@vue_files) {
|
||||
chomp $filepath;
|
||||
my $tidy = qx{yarn --silent run prettier --trailing-comma es5 --semi false --arrow-parens avoid $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;
|
||||
}
|
||||
ok( $content eq $tidy, "$filepath should be kept tidy" );
|
||||
}
|
||||
|
||||
is(scalar(@not_tidy), 0, 'No .vue file should be messy') or diag Dumper \@not_tidy;
|
||||
|
||||
@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 from vue directory should be messy') or diag Dumper \@not_tidy;
|
||||
|
|
|
|||
Loading…
Reference in New Issue