Bug 15646 - koha qa test tools / Test compliance with perlcriticrc
Summary: koha qa test tools / Test compliance with perlcriticrc
Status: In Discussion
Alias: None
Product: Project Infrastructure
Classification: Unclassified
Component: QA tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-22 20:41 UTC by Mark Tompsett
Modified: 2020-01-08 23:00 UTC (History)
3 users (show)

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


Attachments
Allow print function return value to be ignored. (784 bytes, patch)
2016-01-22 20:52 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2016-01-22 20:41:29 UTC
It would be nice to append to the end of the perlcriticrc file for the koha qa test tools:

[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = print
Comment 1 Mark Tompsett 2016-01-22 20:52:27 UTC
Created attachment 47222 [details] [review]
Allow print function return value to be ignored.

TEST PLAN
---------
1) link ~/.perlcriticrc to ~/qa-test-tools/perlcriticrc
2) save simple script
--- BEGIN example.pl ---
#!/usr/bin/perl

use Modern::Perl;
our $VERSION = q{1.0};
print "Hello World!\n";
--- END example.pl ---
3) perlcritic -1 example.pl
Return value of flagged function ignored - print at line 5, column 1.  See pages 208,278 of PBP.  (Severity: 1)
4) Apply this patch to the qa test tools
5) redo step 3
example.pl source OK
Comment 2 Jonathan Druart 2016-01-25 10:14:34 UTC
% perlcritic -1 C4/Auth.pm | wc -l
531

Well, it seems that we are not ready at all for level 1...
Comment 3 Mark Tompsett 2016-02-12 22:15:01 UTC
(In reply to Jonathan Druart from comment #2)
> Well, it seems that we are not ready at all for level 1...

No, but checking the return value for the print function is something I added, because my perlcritic rc file is softlinked to this one, and I sometimes aim to write my code for level 1. :)
Comment 4 Jonathan Druart 2017-05-30 14:25:26 UTC
Could you convince me why we would need this patch?
We do not have any occurrences of my $foo = print('bar') in the code.