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

Bug #20542 PHP CodeSniffer issue on CSS @media
Submitted: 2015-05-05 11:49 UTC
From: saneesh_1980 Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 2.3.2)
PHP Version: 5.5.24 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2015-05-05 11:49 UTC] saneesh_1980 (Saneesh Vasu)
Description: ------------ For the following CSS class, it shows an error. @media (min-width: 320px) and (max-width: 961px) { .tooltipsrt:hover span.tltp, .tooltipsle:hover span.tltp, .tooltipsbt:hover span.tltp, .tooltipsbt1:hover span.tltp, .tooltipsbt2:hover span.tltp, .tooltipstp:hover span.tltp { visibility: hidden; } } If we give the space after the colon(:) the 'hover' will not work in the page (shown below). For a normal css class the space after the colon is fine, but for @media it should not. Expected result: ---------------- This should be passed by the codeSniffer Actual result: -------------- Style definitions must end with a semicolon Expected 1 space after colon in style definition; 0 found

Comments

 [2015-05-05 11:59 UTC] saneesh_1980 (Saneesh Vasu)
Sorry! This issue is not for the standard code sniffers with the PHP_CodeSniffer. This issue is ONLY with the Drupal's code sniffer. I'm not sure I could ask this question here.
 [2015-05-05 12:02 UTC] squiz (Greg Sherwood)
There are included sniffs that are generating these errors from the Squiz standard. The Drupal standard might just be including them, in which case fixing them in PHPCS will fix them in Drupal. If Drupal has copied the sniffs and modified them, you'll need them to make a fix there as well.
 [2015-05-06 00:55 UTC] saneesh_1980 (Saneesh Vasu)
So, what should I do? How can I fix it in Squiz/Drupal standard? What are the modifications I have to do?
 [2015-05-06 00:58 UTC] saneesh_1980 (Saneesh Vasu)
if possible please check the following link too. https://www.drupal.org/node/1431428
 [2015-05-06 01:02 UTC] saneesh_1980 (Saneesh Vasu)
This error it shows when I update the Drupal PHP_CodeSniffer fix. Fatal error: Uncaught exception 'PHP_CodeSniffer_Exception' with message 'Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found' in C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer\Standards\Drupal\Sniffs\Commenting\FileCommentSniff.php on line 13
 [2015-05-06 01:13 UTC] saneesh_1980 (Saneesh Vasu)
I have tried this too. http://cgit.drupalcode.org/drupalcs/commit/?id=905fa01 Still it shows the error. Fatal error: Uncaught exception 'PHP_CodeSniffer_Exception' with message 'Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found' in C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer\Standards\Drupal\Sniffs\Commenting\FileCommentSniff.php on line 13 PHP_CodeSniffer_Exception: Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found in C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer\Standards\Drupal\Sniffs\Commenting\FileCommentSniff.php on line 13 Call Stack: 0.0002 123664 1. {main}() C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\scripts\phpcs:0 0.0125 1057816 2. PHP_CodeSniffer_CLI->runphpcs() C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\scripts\phpcs:25 0.0133 1098816 3. PHP_CodeSniffer_CLI->process() C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer\CLI.php:95 0.0161 1106496 4. PHP_CodeSniffer->initStandard() C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer\CLI.php:830 0.2056 1141904 5. PHP_CodeSniffer->registerSniffs() C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer.php:560 0.3392 1219096 6. include_once('C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer\Standards\Drupal\Sniffs\Commenting\FileCommentSniff.php') C:\wamp\bin\php\php5.5.12\PHP_CodeSniffer\CodeSniffer.php:1318
 [2015-05-06 04:21 UTC] squiz (Greg Sherwood)
-Assigned To: +Assigned To: squiz
The comment parser errors are because you are using a standard written for PHPCS version 1, but you are using PHPCS version 2. Please see the author of the custom coding standard about this issue as I have nothing to do with the Drupal standard. The issue you reported will be investigated as a bug report, but I haven't got the time to look into it right now, so you'll just have to ignore the error message.
 [2015-05-18 06:32 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
A fix for this has been added by this PR: https://github.com/squizlabs/PHP_CodeSniffer/pull/595