Fix the warnings/errors reported by PHP_CodeSniffer

Created on 26 June 2023, over 1 year ago
Updated 21 August 2024, 5 months ago

Problem/Motivation

FILE: /Users/specbee/Sites/Projects/tactic/css/morphist.css
-----------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------
  1 | ERROR | [x] Multiple selectors should each be on a single line
 32 | ERROR | [x] Multiple selectors should each be on a single line
 64 | ERROR | [x] CSS colours must be defined in lowercase; expected #2ab7f4 but found #2AB7F4
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/css/colors.css
-----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------
  7 | ERROR | [x] CSS colours must be defined in lowercase; expected #29baf6 but found #29BAF6
 34 | ERROR | [x] Multiple selectors should each be on a single line
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/css/responsive.css
--------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------------
  44 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 199 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 199 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
 203 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 203 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
 252 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 252 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 253 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 253 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 254 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 254 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 255 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 255 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/css/style.css
--------------------------------------------------------------------------------------
FOUND 16 ERRORS AFFECTING 15 LINES
--------------------------------------------------------------------------------------
  11 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  14 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  15 | ERROR | [x] Expected 1 space after colon in style definition; 2 found
  17 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
  18 | ERROR | [x] Expected 1 space after colon in style definition; 2 found
  23 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
  56 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 110 | ERROR | [x] Blank lines are not allowed in class definitions
 147 | ERROR | [x] Blank lines are not allowed in class definitions
 204 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
 219 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
 306 | ERROR | [x] Multiple selectors should each be on a single line
 405 | ERROR | [x] Multiple selectors should each be on a single line
 405 | ERROR | [x] Expected 1 space before opening brace of class definition; 2 found
 466 | ERROR | [x] Multiple selectors should each be on a single line
 602 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/css/fontawesome.css
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
----------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/css/base.css
-------------------------------------------------------------------------
FOUND 45 ERRORS AFFECTING 45 LINES
-------------------------------------------------------------------------
 160 | ERROR | [x] Multiple selectors should each be on a single line
 450 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 451 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 452 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 453 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 454 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 455 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 456 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 457 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 458 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 459 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 460 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 461 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 462 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 463 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 464 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 465 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 466 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 467 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 468 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 469 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 470 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 471 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 472 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 473 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 474 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 475 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 476 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 477 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 478 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 479 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 480 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 481 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 482 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 483 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 484 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 485 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 486 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 487 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 496 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 497 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 498 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 499 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 500 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
 889 | ERROR | [x] Multiple selectors should each be on a single line
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 45 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/config/install/tactic.settings.yml
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
 33 | ERROR | [x] Expected 1 newline at end of file; 3 found
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/js/morphist.min.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | File appears to be minified and cannot be processed
----------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/js/tactic.js
---------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
---------------------------------------------------------------------------------------------
 14 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 16 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 19 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 21 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 37 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 38 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 39 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 60 | ERROR | [x] Expected 1 newline at end of file; 2 found
 61 | ERROR | [x] Additional whitespace found at end of file
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/README.txt
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 16 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/theme-settings.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 17 LINES
-----------------------------------------------------------------------------------------------------------------------------
   8 | ERROR | [x] Missing function doc comment
  15 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
  80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  81 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  82 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  83 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  84 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  85 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 2
 155 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 156 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
 157 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
 158 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
 159 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
 160 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 2
 222 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 230 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
 253 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/tactic.theme
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 3 WARNINGS AFFECTING 12 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  8 | WARNING | [x] Unused use statement
  8 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
 12 | ERROR   | [x] Line indented incorrectly; expected 1 spaces, found 0
 13 | ERROR   | [x] Line indented incorrectly; expected 1 spaces, found 0
 14 | ERROR   | [x] Line indented incorrectly; expected 1 spaces, found 0
 15 | ERROR   | [x] You must use "/**" style comments for a function comment
 41 | ERROR   | [x] You must use "/**" style comments for a function comment
 49 | ERROR   | [x] You must use "/**" style comments for a function comment
 54 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for
    |         |     xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
 54 | ERROR   | [x] Doc comment short description must end with a full stop
 67 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for
    |         |     xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
 67 | ERROR   | [x] Doc comment short description must end with a full stop
 80 | ERROR   | [x] Expected 1 newline at end of file; 5 found
 83 | ERROR   | [ ] More than 2 empty lines are not allowed
 84 | ERROR   | [ ] More than 2 empty lines are not allowed
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/tactic/tactic.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | "core_version_requirement" property is missing in the info.yml file
-------------------------------------------------------------------------------------------------------------

Time: 488ms; Memory: 14MB

Steps to reproduce

Run following command
phpcs --standard=โ€œDrupal,DrupalPracticeโ€ --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js .

๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sonam_sharma

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

  • Issue created by @sonam_sharma
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Harshita mehra

    Harshita mehna โ†’ made their first commit to this issueโ€™s fork.

  • @sonam_sharma opened merge request.
  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The issue summary should always describe what the issue is trying to fix and, in the case of coding standards issues, show which command and arguments have been used and which report that command shown. In this way, project maintainers can verify the patch/MR fixes all the warnings/errors.

  • Assigned to imustakim
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada imustakim Canada

    Issue summary updated.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada imustakim Canada

    Patch updated, please review.
    Remaining warnings after the changes, assuming this can be ignored.

    FILE: /Users/specbee/Sites/Projects/tactic/css/fontawesome.css
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ----------------------------------------------------------------------
    
    
    FILE: /Users/specbee/Sites/Projects/tactic/js/morphist.min.js
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ----------------------------------------------------------------------
    
    Time: 246ms; Memory: 14MB
    
  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines cleavinjosh

    Hi @imustakim,

    I applied patch #7, it was applied smoothly and fixed most of the phpcs issues.

    These are the remaining issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml:

    โžœ  tactic git:(1.x) curl https://www.drupal.org/files/issues/2023-07-04/3370114-7.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 13220  100 13220    0     0   8343      0  0:00:01  0:00:01 --:--:--  8340
    patching file README.txt
    patching file config/install/tactic.settings.yml
    patching file css/base.css
    patching file css/colors.css
    patching file css/morphist.css
    patching file css/responsive.css
    patching file css/style.css
    patching file js/tactic.js
    patching file tactic.info.yml
    patching file tactic.theme
    patching file theme-settings.php
    โžœ  tactic git:(1.x) โœ— ..
    โžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig tactic
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/tactic/css/fontawesome.css
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ----------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/tactic/templates/partial/footer.html.twig
    -------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
     43 | ERROR | [x] Expected 1 newline at end of file; 2 found
    -------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------
    
    Time: 295ms; Memory: 14MB
    
    โžœ  contrib

    Thank you.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Let's create a merge request, now that patches are no longer tested.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    avpaderno โ†’ changed the visibility of the branch 3370114-fix-the-issues to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    avpaderno โ†’ changed the visibility of the branch 3370114-fix-phpcs-issues to hidden.

Production build 0.71.5 2024