I would like my generated Makefile to have these new tasks for linting:
perl:
-for f in **/*.pl; do perl -MO=Lint -cw $$f 2>&1 | grep -v "syntax OK"; done
-for f in **/*.pm; do perl -MO=Lint -cw $$f 2>&1 | grep -v "syntax OK"; done
perlcritic:
-perlcritic . | grep -v "source OK"
lint: perl perlcritic
I tried writing a Makefile.PL
, but when I run it, the resulting Makefile still lacks the lint
task.
use ExtUtils::MakeMaker;
sub MY::lint {
return <<'END';
lint:
echo "Linting!!!!!!!!!!!1"
END
}
WriteMakefile;
I tried reading the CPAN docs, but like most docs, they give snippets without sufficient context, so I'm not even sure if I should declare the subs before or after WriteMakefile
.
Also posted on Reddit.
Thanks to briandfoy: