The Perl::Critic thing could be tricky though.

One of the very few things PPI does that isn't round-trip safe (actually, the ONLY thing) is localise the newlines for the files it opens.

And given that I live on a hybrid Win32/linux setup, PPI is also one of the very few things that is actually comfortable dealing with mixed newlines.

So if you can do the check without involving PPI at all fine, but beware that mixed newlines are going to get "fixed" automatically as soon as it touches the tokenizer... :/

How ironic that dealing with newlines correctly makes it harder :)

Adam K

Jeffrey Thalhammer wrote:
So I'd like to propose the following for inclusion.

Metric: consistent_newlines

The distribution is awarded a point IF for ALL text
files within the distribution EACH file contains
EITHER exclusively unix newlines OR exclusively
Win32 newlines.
In addition, I'd be happy to cook up a Perl::Critic
policy to cover that.  It probably wouldn't fix the
problem with the SIGNATURE files, but it would cover
any scripts and modules.

-Jeff



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Reply via email to