Bug 15646

Summary: koha qa test tools / Test compliance with perlcriticrc
Product: Project Infrastructure Reporter: Mark Tompsett <mtompset>
Component: QA toolsAssignee: Mark Tompsett <mtompset>
Status: In Discussion --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, robin
Version: unspecified   
Hardware: All   
OS: All   
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.

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.