On Tue, Aug 5, 2008 at 1:07 PM, Galen Charlton <[EMAIL PROTECTED]> wrote: > Hi, > > Perl's warnings pragma is the cheapest way to find bugs. We already > use the strict pragma; now it's time to add warnings. More > importantly, it's time to review the messages produced by the warnings > pragma and fix the underlying issues. > > To reiterate, this RFC has two goals: turning on warnings, and fixing > all warnings thus reported. Doing the first without the second will > simply cause Apache logs to overflow. > > Ideally, all Perl scripts and modules should have warnings enabled by > the time 3.2 is released. > > I propose the following steps to implement this: > > 1. Update the coding guidelines to require 'use strict' and 'use warnings'. > 2. For any new scripts and modules, require 'use warnings'. Since Koha > (per Makefile.PL) requires at least Perl 5.6.1, the 'use warnings' > pragma should be used instead of -w. > 3. Systematically go through and turn on warnings for each script and module. > 4. Unsystematically turn on warnings. I.e., whenever you patch a > particular script, consider following up with a separate patch to turn > on warnings. I suggest a separate patch because turning on warnings is > not enough; you should run the script through its paces and fix any > problems reported by the warnings pragma. For modules in C4, note that > this can be a big commitment: turning on warnings means testing every > function and method. > 5. Create a standing blocker bug for 3.2 for adding "use warnings". > 6. "no warnings" should not be used absent a detailed comment > explaining why warnings should be turned off within a block and why it > is not possible to change the code to avoid the warning. It _might_ be > acceptable for temporary use while turning on warnings in a big module >
Excellent idea! It will go a long way toward adding some syntactical law and order to our code. -- Chris Nighswonger LibLime www.liblime.com [EMAIL PROTECTED] _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel