Subject: | Perl::Tidy 20120619 breaks Perl::Critic::Policy::CodeLayout::RequireTidyCode |
Perl::Tidy version 20120619 breaks CodeLayout::RequireTidyCode. There
appear actually to be three breakages:
1) The stderr argument to perltidy() no longer takes a scalar reference.
This is a documented change. Fortunately Perl::Critic already has
IO::String as a dependency, so the solution is to instantiate an
IO::String object from the $stderr variable, and pass that.
2) Perl::Tidy now chomps the perltidyrc string. This fails if it is
passed a reference to a Readonly::Scalar, and throws an exception. The
solution is to assign $EMPTY to a scalar variable, and pass that.
3) If you pass a scalar reference as the source argument to perltidy(),
it is modified after the call -- the trailing newline is removed. The
only solution I can come up with is more ad-hocery.
Numbers 2 and 3 appear to me to be worthy of an RT ticket against
Perl::Tidy.
Patches for all the above are in preparation.