[Bug 15871] New: Improve perl critic of t/RecordProcessor.t
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Bug ID: 15871 Summary: Improve perl critic of t/RecordProcessor.t Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: mtompset@hotmail.com QA Contact: testopia@bugs.koha-community.org perlcritic -5 t/RecordProcessor fails with: Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) This is because of a hacky good single line of code. While correcting this for improved readability, attempt to get this to a higher level of perl critic. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|gmcharlt@gmail.com |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 48255 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48255&action=edit Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=6679 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15870 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15870 [Bug 15870] Add Filter for MARC to respect visibility settings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|15870 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15870 [Bug 15870] Add Filter for MARC to respect visibility settings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15870 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15870 [Bug 15870] Add Filter for MARC to respect visibility settings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48255|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 48257 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48257&action=edit Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15777 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15777 [Bug 15777] Refactor loop in which Record::Processor does not initialize parameters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Marked as trivial rather than an enhancement, because technically, the failure of perlcritic level 5 would mean it wouldn't pass koha qa test tools. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48257|0 |1 is obsolete| | --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 48325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48325&action=edit Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48325|0 |1 is obsolete| | --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 48326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48326&action=edit Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Cleaned up after a rebase. Ready for signoff. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48326|0 |1 is obsolete| | --- Comment #7 from Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> --- Created attachment 48336 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48336&action=edit [SIGNED-OFF]Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |hector.hecaxmmx@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 --- Comment #8 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 48349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48349&action=edit [SIGNED-OFF] Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48336|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48349|0 |1 is obsolete| | --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 48631 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48631&action=edit Bug 15871: Improve PerlCritic level for t/RecordProcessor.t perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> I don't really care about perlcritic as long as it involves changing '' into qw{} (WTF?) Anyway, I'd do this kind of things as we go, for example, if we were adding more tests. In that case it would just be a followup for this, after you provided a patch for an enh/bugfix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m Status|Passed QA |Pushed to Master --- Comment #10 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - Should be in the May 2016 Release. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15871 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |julian.maurice@biblibre.com --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Patch pushed to 3.22.x, will be in 3.22.5 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org