Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 38943
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: 'module' rules could explain better that they want a shebang line
The following program is missing the shebang line: # $Id $ use warnings; use strict; use 5.010; say 'hello'; However when you run perlcritic -1 on it, the warning you get is not 'shebang line missing' but some confusing stuff about no explicit package and no final 1;. The policies are okay, but the explanatory text could say either mark it as a script with #!whatever or else mark it as a module with 'package whatever'.
I just supplied a patch to unify the code exempting scripts (see 39024). It could be made a little smarter by simply looking to see if the filename ends with a .pm and ignore it otherwise.
This was ultimately accomplished with the prepare_to_scan_document() method, which allows a policy to indicate that it doesn't apply to certain types of documents (e.g. scripts or modules).