Edit report at http://pear.php.net/bugs/bug.php?id=18628&edit=1
ID: 18628
Updated by: [email protected]
Reported By: pear at kennel17 dot co dot uk
Summary: Generic.Files.LineLength gives incorrect results with
Windows line-endings.
-Status: Verified
+Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Operating System: Ubuntu
Package Version: 1.3.0
PHP Version: 5.2.8
Assigned To: squiz
Roadmap Versions:
New Comment:
-Status: Verified
+Status: Closed
This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2011-07-13 05:29:32] squiz
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: squiz
------------------------------------------------------------------------
[2011-06-24 16:42:12] happydog
Description:
------------
The built-in rule, Generic.Files.LineLength, doesn't handle files with
Windows line-endings (\r\n) correctly.
It treats the \r character (carriage-return) as part of the line, and
therefore miscounts the length of each line as one greater than it
should be.
If you are in a build environment where all files are in Windows-format,
then there is a workaround (to set the maximum line length as one
greater than your actual limit) but this is not intuitive, nor
documented. It also does not work in environments where the
line-endings may vary between files (e.g. where there is third-party
code).
I am aware that the code was built based on PEAR standards, but there is
a separate rule to check appropriate line-ending characters are in
place, but this is a separate rule which should be eol-style agnostic.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18628&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.