Subject: | Feature: unsafe policies |
As I understand it Perl::Critic parses the program with PPI. It would
be useful to have a check that 'perl -c' passes. This is not much of a
policy, since the program has to be syntactically correct to run at all,
but it can still be useful when batch-verifying programs (as in a
version control system pre-commit hook or as part of a test suite).
Now 'perl -c' evaluates some of the code so it is not safe to run it on
arbitrary input. So I suggest this and similar policies would be turned
on with an --unsafe command line flag.
Another unsafe policy would be to check that Perl programs support
--help, --version etc. (PBP page 303.) To do this you must run the
program and see what it does.
If you like the idea I'll write a patch when I have some time.