Yet Another New Perl::Critic policy in the pipeline: RequirePackageNamePattern

I have written up a first working version of yet another Perl::Critic policy, also this policy suggestion is highly experimental.

The policy assists in enforcing a package/module/class naming strategy, so if you prefer to have your modules names follow a certain pattern this policy could be of interest to you.

If you do not configure the policy it does not do anything. You can however configure it with as many patterns as you would like:

Patterns could look as follows:

^Acme # if you want all of you modules to start with Acme
Acme # if you want all of your modules to contain the work Acme
Acme$ # if you want all of you modules to end with Acme

For now you can only specify global patterns, but I was considering looking into the ability to specify different patterns for different directories:

Names
lib = <pattern1> || <pattern2>
t = <pattern1> || <pattern3>

And creating more complex patterns would also be great, like:

^Acme.*Test$

or:

^Acme && Test$

In addition the policy has the following configurable parameters:

– debug (for debugging)

– exempt_programs, so scripts etc. are not evaluated, these can however be of interest if you use inline packages

The motivation is to use the policy as a part of a coding standard for use at my work place, but I have developed it in my spare time since I wanted to contribute it to CPAN and as for my other policies I would like too use it on my own open source code base to begin with.

I will pack it up and push it to CPAN in a few days, but you are welcome to check it out on Github, please note that the policy is by no means done and much work remains.

jonasbn, logicLAB

Yet Another New Perl::Critic policy in the pipeline: RequirePackageNamePattern

New Perl::Critic policy in the pipeline: RequireParamsValidate

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

New Perl::Critic policy in the pipeline: RequireParamsValidate

Nordic Perl Workshop 2013

The Nordic Perl Workshop for 2013 is just over. I had promised myself to write a blog post up to the event, but organization, $job and life took what little time I had.

The event was hosted by my employer DK Hostmaster and took place in Copenhagen and I was involved in the organizing.

With a varied one-track schedule, with talks on topic like: Hadoop, Prima, Carton, SVG, natural language processing, Perl 6, Postgres, Mojolicious and Websockets the workshop provided a nice platform to learn, reflect and socialize.

It was nice to see old friends and make new friends and everything went really well. I did two lightning talks on Perl::Critic (peer/code review) and Mojolicious and REST. I planned to do a follow-up on my Jenkins talk, with some updates on perlbrew, but I dod not have the time to get it prepared.

One presentation which I found really interesting was Tatsuhikos Miyagawas presentation on Carton. Carton is a bundler handling CPAN dependencies and it is most impressive and together with cpanm and App::scan_prereqs_cpanfile (by TOKUHIROM) it is a serious contribution to the Perl toolchain.

When I get my notes processed, I will do a brief write-up of my reflection of Carton. I am going to evaluate possible use of Carton at my place of work and it could be what we need to get our deployment process really rolling.

Make sure to crowdsource or follow the Lanyard site if you want to access more information on the Nordic Perl Workshop 2013.

Next years workshop will be in Helsinki, Finland – hope to see you there.

Nordic Perl Workshop 2013