Bug 15258 - Prevent unused declared variables
Summary: Prevent unused declared variables
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Frédéric Demians
QA Contact: Galen Charlton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-26 07:25 UTC by Frédéric Demians
Modified: 2017-06-14 22:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15258 Fix Perl scripts declaring unused variables (19.66 KB, patch)
2015-11-26 07:29 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 15258 Fix Perl scripts declaring unused variables (19.66 KB, patch)
2015-11-26 07:30 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 15258 Prevent unused declared variables (2.56 KB, patch)
2015-11-26 07:31 UTC, Frédéric Demians
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15258: Prevent unused declared variables (2.66 KB, patch)
2015-11-30 16:57 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15258 Fix Perl scripts declaring unused variables (19.72 KB, patch)
2015-11-30 17:00 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15258: Fix Perl scripts declaring unused variables (19.79 KB, patch)
2015-11-30 17:06 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15258: Fix Perl scripts declaring unused variables (19.79 KB, patch)
2015-11-30 17:08 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15258: Prevent unused declared variables (2.66 KB, patch)
2015-11-30 17:09 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15258: Fix Perl scripts declaring unused variables (19.79 KB, patch)
2015-12-01 14:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15258: Prevent unused declared variables (2.72 KB, patch)
2015-12-01 14:47 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Demians 2015-11-26 07:25:04 UTC
Add a perlcritic rule to 00-perlcritic.t to prevent unused declared variable.
Comment 1 Frédéric Demians 2015-11-26 07:29:40 UTC Comment hidden (obsolete)
Comment 2 Frédéric Demians 2015-11-26 07:30:04 UTC Comment hidden (obsolete)
Comment 3 Frédéric Demians 2015-11-26 07:31:03 UTC Comment hidden (obsolete)
Comment 4 Héctor Eduardo Castro Avalos 2015-11-30 16:57:21 UTC Comment hidden (obsolete)
Comment 5 Héctor Eduardo Castro Avalos 2015-11-30 17:00:41 UTC Comment hidden (obsolete)
Comment 6 Héctor Eduardo Castro Avalos 2015-11-30 17:06:02 UTC Comment hidden (obsolete)
Comment 7 Héctor Eduardo Castro Avalos 2015-11-30 17:08:55 UTC Comment hidden (obsolete)
Comment 8 Héctor Eduardo Castro Avalos 2015-11-30 17:09:31 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-12-01 14:47:25 UTC
Created attachment 45270 [details] [review]
Bug 15258: Fix Perl scripts declaring unused variables

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2015-12-01 14:47:32 UTC
Created attachment 45271 [details] [review]
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.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2015-12-01 14:48:27 UTC
Well done Frédéric :)

I have added a new rule to the qa script:
  commit e50dc8eae505819ff3c9a7af67de7e2498c66902
  CommitDate: Tue Dec 1 14:45:37 2015 +0000
    Add ProhibitUnusedVariables to perlcritic rules
Comment 12 Jesse Weaver 2015-12-31 00:25:37 UTC
Pushed to master. Thanks for your contribution!
Comment 13 Julian Maurice 2015-12-31 13:36:43 UTC
Patch pushed to 3.22.x, will be in 3.22.2