[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg perl critic code cleanup

On Mon, 2012-12-31 at 18:40:03 -0800, Russ Allbery wrote:
> Russ Allbery <rra@debian.org> writes:
> > Oh, glad it was helpful!  In case it's of interest, attached are my
> > current perlcriticrc and perltidyrc files.  (perltidy is... awkward.
> > There are places where how it formats the code is clearly suboptimal, at
> > least to me, and despite initial appearances it doesn't have enough
> > dials.  But I'm sticking with it so far.)
> Oh, and feel free to use the perlcriticrc file under whatever license you
> want; I don't actually care (nor will Stanford).  It's just long enough
> that my license heuristics want it to have some license, and I tend to
> slap the Expat license on things in that case.

Thanks! I took a peek for inspiration but ended up going through every
and each perlcritic policy. I've also implemented the check with both
explict white and blacklists [0], to get more reliable results and so
that more checks can be enabled incrementally (queued for pushes) while
being able to do global checks out of band for new/changed violations
with the following script (which I guess I'll put in the repo at some
point in the future):

,--- critic ---

files_default="test utils/t src/t scripts/t dselect
  scripts/Dpkg.pm scripts/Dpkg
  scripts/*.pl scripts/changelog/*.pl"


perlcritic --profile $profile $files | tee critic.out | \
  grep '^  Perl::Critic::Policy' | sort | uniq -c >critic.sum

[0] <http://anonscm.debian.org/gitweb/?p=dpkg/dpkg.git;a=blob;f=test/100_critic.t;hb=HEAD>

Also feel free to use these back (if interested :) with any license you
want, I slaped there GPL2+ just for consistency with the rest of the


Reply to: