Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0RC3

Bug #20346 Fixer endless loop with Squiz.CSS sniffs
Submitted: 2014-07-11 21:57 UTC Modified: 2014-07-14 01:01 UTC
From: klausi Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.5.14 OS: Ubuntu
Roadmaps: (Not assigned)    
Subscription  


 [2014-07-11 21:57 UTC] klausi (Klaus Purer)
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.

Comments

 [2014-07-11 22:06 UTC] klausi (Klaus Purer)
A git bisect turned out that commit 2970c664ed8b74c99f5bc355f07d9b937311cb22 introduced the bug.
 [2014-07-14 01:01 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/8addacc722e08072a25c46ab54 de9d51e74bef82