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

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

 [2014-07-12 02: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.


 [2014-07-12 03:06 UTC] klausi (Klaus Purer)
A git bisect turned out that commit 2970c664ed8b74c99f5bc355f07d9b937311cb22 introduced the bug.
 [2014-07-14 06:01 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to github repo: de9d51e74bef82