[PEAR-BUG] Bug #20346 [Com]: Fixer endless loop with Squiz.CSS sniffs

[email protected] ("[email protected]")
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=20346&edit=1

 ID:               20346
 Comment by:       [email protected]
 Reported By:      klaus dot purer at gmail dot com
 Summary:          Fixer endless loop with Squiz.CSS sniffs
 Status:           Open
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: Ubuntu
 Package Version:  SVN
 PHP Version:      5.5.14
 Roadmap Versions: 
 New Comment:

A git bisect turned out that commit
2970c664ed8b74c99f5bc355f07d9b937311cb22 introduced the bug.


Previous Comments:
------------------------------------------------------------------------

[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.