New Perl::Critic policy in the pipeline: RequireParamsValidate

In: Articles

26 Nov 2013

Inspired by my fellow hackers attending the Nordic Perl Workshop, I took the time to sit down (I was actually attending the Internetdagarna conference in Stockholm) and wrote up a first working version, so for now I consider this policy suggestion highly experimental.

The policy evaluates Perl subroutines for the presence of use of Params::Validate. It currently only evaluates public facing APIs, meaning subroutines prefixed with ‘_’ (private by convention) are ignored. This will be made configurable later.

I have run some basic tests and found one funny thing – the implementation itself does not comply with what the policy enforces and encourages.

The motivation is to use the policy as a part of a coding standard for a larger project on which I am embarking soon, but I would like too use it on my own code base to begin with.

I will pack it up and push it to CPAN within a few days, but you are welcome to check it out on Github.

jonasbn, logicLAB

Comment Form

About this blog

This blog acts as a channel for communicating logicLAB’s open source activities. Announcements on open source initiatives, involvements and releases of open source distributions of software products, projects and applications.

Photostream

  • jonasbn: Book wrote a more elaborate piece on CPAN deletions, which is worth mentioning: http://blogs.perl [...]
  • Neil Bowers: It would be good to hear your thoughts on supporting both an OO and procedural interface: what was t [...]
  • J: I'm experiencing the same issue as Petar. Anytime I click on any file, ‘No violations found’. N [...]
  • Petar: Nevermind that, I solved it with: perlcritic --brutal --verbose 5 lib t > perlcritic.txt || EX [...]
  • Petar: Hi Jonas, I tried adding perlcritic command as Windows batch command, but since my code has viola [...]

Calendar

November 2013
M T W T F S S
« Jul   Jan »
 123
45678910
11121314151617
18192021222324
252627282930