]> git.koha-community.org Git - koha.git/commit
Bug 21395: Make perlcritic happy
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 21 Sep 2018 16:05:42 +0000 (18:05 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 29 Jun 2020 10:37:02 +0000 (12:37 +0200)
commitb168f4a2e9a03ed56ce857353d4dde940980caba
tree1b80905ba3bc5215af7b4e7c685e711aeca13940
parent9d890c7636ef1d6ec0a1de2161906fd9f4375e97
Bug 21395: Make perlcritic happy

This patch adds a .perlcriticrc (copied from qa-test-tools) and fixes
almost all perlcrictic violations according to this .perlcriticrc
The remaining violations are silenced out by appending a '## no critic'
to the offending lines. They can still be seen by using the --force
option of perlcritic
This patch also modify t/00-testcritic.t to check all Perl files using
the new .perlcriticrc.
I'm not sure if this test script is still useful as it is now equivalent
to `perlcritic --quiet .` and it looks like it is much slower
(approximatively 5 times slower on my machine)

Test plan:
1. Run `perlcritic --quiet .` from the root directory. It should output
   nothing
2. Run `perlcritic --quiet --force .`. It should output 7 errors (6
   StringyEval, 1 BarewordFileHandles)
3. Run `TEST_QA=1 prove t/00-testcritic.t`
4. Read the patch. Check that all changes make sense and do not
   introduce undesired behaviour

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
130 files changed:
.perlcriticrc [new file with mode: 0644]
C4/Accounts.pm
C4/Acquisition.pm
C4/Auth_with_cas.pm
C4/AuthoritiesMarc.pm
C4/Barcodes/ValueBuilder.pm
C4/Barcodes/annual.pm
C4/Biblio.pm
C4/ClassSortRoutine.pm
C4/ClassSplitRoutine/RegEx.pm
C4/Context.pm
C4/CourseReserves.pm
C4/Creators.pm
C4/Creators/Lib.pm
C4/ImportBatch.pm
C4/InstallAuth.pm
C4/Items.pm
C4/Labels.pm
C4/Labels/Label.pm
C4/Languages.pm
C4/Letters.pm
C4/Matcher.pm
C4/Members/Messaging.pm
C4/Patroncards.pm
C4/Patroncards/Patroncard.pm
C4/Record.pm
C4/Ris.pm
C4/Search.pm
C4/Serials.pm
C4/Templates.pm
Makefile.PL
docs/CAS/CASProxy/examples/koha_webservice.pl
docs/CAS/CASProxy/examples/proxy_cas_callback.pl
docs/CAS/CASProxy/examples/proxy_cas_data.pl
fix-perl-path.PL
installer/data/mysql/labels_upgrade.pl
installer/data/mysql/patroncards_upgrade.pl
installer/data/mysql/update22to30.pl
installer/data/mysql/updatedatabase.pl
installer/externalmodules.pl
installer/install.pl
misc/admin/koha-preferences
misc/batchRepairMissingBiblionumbers.pl
misc/batchdeletebiblios.pl
misc/bin/connexion_import_daemon.pl
misc/check_sysprefs.pl
misc/cronjobs/build_browser_and_cloud.pl
misc/cronjobs/gather_print_notices.pl
misc/cronjobs/holds/cancel_expired_holds.pl
misc/cronjobs/longoverdue.pl
misc/cronjobs/rss/rss.pl
misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl
misc/cronjobs/update_totalissues.pl
misc/exportauth.pl
misc/link_bibs_to_authorities.pl
misc/maintenance/cmp_sysprefs.pl
misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl
misc/maintenance/touch_all_biblios.pl
misc/maintenance/touch_all_items.pl
misc/migration_tools/22_to_30/export_Authorities.pl
misc/migration_tools/22_to_30/export_Authorities_xml.pl
misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl
misc/migration_tools/buildCOUNTRY.pl
misc/migration_tools/buildEDITORS.pl
misc/migration_tools/buildLANG.pl
misc/migration_tools/bulkmarcimport.pl
misc/migration_tools/remove_unused_authorities.pl
misc/perlmodule_rm.pl
misc/translator/LangInstaller.pm
misc/translator/TmplTokenizer.pm
misc/translator/VerboseWarnings.pm
misc/translator/po2json
misc/translator/tmpl_process3.pl
misc/translator/xgettext.pl
opac/opac-MARCdetail.pl
opac/opac-alert-subscribe.pl
opac/opac-authorities-home.pl
opac/opac-authoritiesdetail.pl
opac/opac-basket.pl
opac/opac-search.pl
opac/opac-serial-issues.pl
opac/opac-showreviews.pl
patroncards/create-pdf.pl
patroncards/image-manage.pl
patroncards/print.pl
plugins/plugins-upload.pl
reports/acquisitions_stats.pl
reports/bor_issues_top.pl
reports/borrowers_out.pl
reports/catalogue_out.pl
reports/catalogue_stats.pl
reports/issues_avg_stats.pl
reports/issues_stats.pl
reports/reserves_stats.pl
rewrite-config.PL
svc/holds
t/00-testcritic.t
t/Languages.t
t/Prices.t
t/SuggestionEngine.t
t/db_dependent/Accounts.t
t/db_dependent/Acquisition/OrderFromSubscription.t
t/db_dependent/Acquisition/OrderUsers.t
t/db_dependent/Barcodes.t
t/db_dependent/Context.t
t/db_dependent/Hold.t
t/db_dependent/LDAP/test_ldap_add.pl
t/db_dependent/Record/Record.t
t/db_dependent/Search.t
t/db_dependent/Serials.t
t/db_dependent/Serials_2.t
t/db_dependent/XISBN.t
t/db_dependent/cronjobs/advance_notices_digest.t
t/db_dependent/www/auth_values_input_www.t
t/dummy.t
t/perlcriticrc [deleted file]
tags/review.pl
tools/batchMod.pl
tools/export.pl
tools/import_borrowers.pl
tools/letter.pl
tools/modborrowers.pl
tools/overduerules.pl
tools/picture-upload.pl
tools/upload-cover-image.pl
xt/author/show-template-structure.pl
xt/author/translatable-templates.t
xt/find-license-problems.t
xt/fix-old-fsf-address
xt/single_quotes.t