Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl::Critic: Life after Moose?

I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to.

Are there docs anywhere on how to make critic/tidy be more appreciative of the Moose dialect? What do most Moose users do? Relax/ditch critic for the more heavy Moose modules? Custom policies?

like image 342
claco Avatar asked Sep 18 '08 13:09

claco


2 Answers

Have you seen Perl::Critic::Moose?

like image 146
brian d foy Avatar answered Sep 28 '22 00:09

brian d foy


Both of them can be configured into detail.

I have no idea why perltidy wouldn't like it, it has nothing to do with it. Perltidy only governs style. You can change the style of your code without changing any functionality, it's mostly a matter of whitespace really. You should either change your style or change the perltidy configuration using the .perltidyrc file.

I don't know what problems perlcritic has with it (lvalue methods perhaps?), but you could consider turning off those specific policies using the .perlcriticrc file. Also, if your perlcritic is old you may want to upgrade it, as some old versions gave some incorrect errors in Moose classes.

like image 30
Leon Timmermans Avatar answered Sep 28 '22 00:09

Leon Timmermans