In the gap before Kwalitee shows it's head and we get another CPANTS update, I thought I'd throw a new one into the ring.

I've twice now hit problems relating to SIGNATURE files.

SPECIFICALLY, I see problems with files that have _mixed_ newline types.

That is, part of the file is unix newlines, parts of it are Win32 newlines. There is a LOT of things that might auto-detect unix or Win32, but struggle or fail when the file starts as unix, but has Win32 newlines for only part of the file.

In particular, it breaks Module::Signature in platform-sensitive ways, as the newlines are going to be corrected differently on different platforms, resulting in abnormal Digest::MD5/SHA/et-al results.

This sort of thing is very tricky to catch and hunt down, I wasted several hours the first time.

And it catches both good people and bad, with the two modules I've encountered in real life so far being an Audrey Tang module, and Digest::SHA itself.

This is the sort of thing that is ideal to include in a mass-testing regime like Kwalitee.

A mixture of different newlines types in different files is not necesarily problematic, so the "unix or Win32" applies per-file. It is only when a file contains a mixture of both that problems seem to occur.

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.

Adam K

Reply via email to