Edit report at https://pear.php.net/bugs/bug.php?id=20346&edit=1
ID: 20346
Updated by: [email protected]
Reported By: klaus dot purer at gmail dot com
Summary: Fixer endless loop with Squiz.CSS sniffs
-Status: Open
+Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Operating System: Ubuntu
Package Version: SVN
PHP Version: 5.5.14
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: squiz
Fix committed to github repo:
https://github.com/squizlabs/PHP_CodeSniffer/commit/8addacc722e08072a25c46ab54
de9d51e74bef82
Previous Comments:
------------------------------------------------------------------------
[2014-07-11 23:06:25] klausi
A git bisect turned out that commit
2970c664ed8b74c99f5bc355f07d9b937311cb22 introduced the bug.
------------------------------------------------------------------------
[2014-07-11 22:57:00] klausi
Description:
------------
If there is an empty style deinfition in CSS (detected by
Squiz.CSS.EmptyStyleDefinition.Found) then that CSS file cannot be fixed
with PHPCBF because it gets trapped in an endless loop.
The problem is that Squiz.CSS.SemicolonSpacing.SpaceFound and
Squiz.CSS.ColonSpacing.NoneAfter trigger each other. This problem is not
caught by the unit tests, because they only test each sniff type in
isolation.
Test script:
---------------
#forum .description{
background: ; /* Empty style definitions are not allowed. */
}
Expected result:
----------------
PHPCBF should fix the white space issues in the CSS file.
Actual result:
--------------
PHPCBF does not fix anything.
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20346&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.