Bugzilla – Attachment 45232 Details for
Bug 15258
Prevent unused declared variables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 15258: Prevent unused declared variables
SIGNED-OFFBug-15258-Prevent-unused-declared-variab.patch (text/plain), 2.66 KB, created by
Héctor Eduardo Castro Avalos
on 2015-11-30 16:57:21 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 15258: Prevent unused declared variables
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2015-11-30 16:57:21 UTC
Size:
2.66 KB
patch
obsolete
>From c4fecd0b2b9ac2956455d304735c796fcc031484 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Thu, 26 Nov 2015 07:30:42 +0100 >Subject: [PATCH] [SIGNED-OFF]Bug 15258: Prevent unused declared variables > >Add a perlcritic rule to 00-perlcritic.t to prevent unused declared >variable. > >TO TEST: > >- Apply the 1st patch (unit test) >- Run the UT: > prove -v t/00-testcritic.t >- Note that several Perl script fail >- Apply the 2nd patch >- Run the UT, and confirm it passes. > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >All tests pass successful. >--- > t/00-testcritic.t | 31 +++++++++++++++++++++++-------- > t/perlcriticrc | 5 +++-- > 2 files changed, 26 insertions(+), 10 deletions(-) > >diff --git a/t/00-testcritic.t b/t/00-testcritic.t >index fa0fcc3..8a7f5d2 100755 >--- a/t/00-testcritic.t >+++ b/t/00-testcritic.t >@@ -1,6 +1,4 @@ > #!/usr/bin/env perl >-use strict; >-use warnings; > > # This script can be used to run perlcritic on perl files in koha > # It calls its own custom perlcriticrc >@@ -8,16 +6,33 @@ use warnings; > # and the environment variable TEST_QA to be set > # At present only the directories in @dirs will pass the tests in 'Gentle' mode > >+use Modern::Perl; > use File::Spec; > use Test::More; > use English qw(-no_match_vars); > >-my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing circ course_reserves debian errors >-labels members misc offline_circ opac patroncards patron_lists reports reserve reviews rotating_collections >-serials sms suggestion t tags test tools virtualshelves Koha); >- >-my @dirs = qw( acqui admin authorities basket catalogue cataloguing circ debian errors labels >- members offline_circ reserve reviews rotating_collections serials sms virtualshelves Koha C4/SIP); >+my @dirs = qw( >+ acqui >+ admin >+ authorities >+ basket >+ catalogue >+ cataloguing >+ circ >+ debian >+ errors >+ labels >+ members >+ offline_circ >+ reserve >+ reviews >+ rotating_collections >+ serials >+ sms >+ virtualshelves >+ Koha >+ C4/SIP >+); > > if ( not $ENV{TEST_QA} ) { > my $msg = 'Author test. Set $ENV{TEST_QA} to a true value to run'; >diff --git a/t/perlcriticrc b/t/perlcriticrc >index 69b3d74..bf0c9e4 100644 >--- a/t/perlcriticrc >+++ b/t/perlcriticrc >@@ -1,6 +1,7 @@ >+severity = 5 >+include = ProhibitUnusedVariables > exclude = Miscellanea::RequireRcsKeywords > >- > [Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval] > allow_includes =1 > >@@ -8,4 +9,4 @@ allow_includes =1 > equivalent_modules = Modern::Perl > > [TestingAndDebugging::RequireUseWarnings] >-equivalent_modules = Modern::Perl >\ No newline at end of file >+equivalent_modules = Modern::Perl >-- >1.7.10.4
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 15258
:
45177
|
45178
|
45179
|
45232
|
45233
|
45234
|
45235
|
45236
|
45270
|
45271