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

Bug #21010 Incorrect missing colon detection in CSS when first style is not on new line
Submitted: 2015-12-28 21:43 UTC
From: h3xx Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.6.15 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2015-12-28 21:43 UTC] h3xx (Dan Church)
Description: ------------ There is an issue detecting missing colons in CSS files when lines are formatted a certain way. Note: Occurs when using Squiz.CSS.MissingColon as part of either a custom XML ruleset, or the Squiz ruleset, but NOT when using the default PHP_CodeSniffer ruleset with --sniffs=Squiz.CSS.MissingColon appended. Tested on current git revision (ce29188 2015-12-28). Steps to reproduce: $ phpcs -s --standard=Squiz -- sniffs=Squiz.CSS.MissingColon test.css Test script: --------------- #foo { background-color: #FF0000; } Expected result: ---------------- No output. Actual result: -------------- FILE: /home/dchurch/test.css ------------------------------------------------------------ ---------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------ ---------- 1 | ERROR | No style definition found on line; check for missing | | colon (Squiz.CSS.MissingColon.Found) ------------------------------------------------------------ ---------- Time: 16ms; Memory: 2.25Mb

Comments

 [2015-12-29 06:53 UTC] squiz (Greg Sherwood)
-Summary: Incorrect missing colon detection (CSS) +Summary: Incorrect missing colon detection in CSS when first style is not on new line -Assigned To: +Assigned To: squiz
 [2015-12-29 06:55 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
A fix has been committed here: https://github.com/squizlabs/PHP_CodeSniffer/commit/a1e7a2c65dcf6fdea9c4586d07706f8c6017972 6 Thanks for reporting it.