Fix the issues reported by phpcs

Created on 19 May 2023, over 1 year ago
Updated 30 June 2023, over 1 year ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml ./himalaya where ./himalaya is the directory containing the 8.x-5.x branch (obtained with git clone --branch 8.x-5.x https://git.drupalcode.org/project/himalaya.git shows the following errors/warnings that need to be fixed (apart replacing true and false with TRUE and FALSE in JavaScript files).


FILE: ./himalaya/himalaya.libraries.yml
-------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------
 15 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------


FILE: ./himalaya/css/custom.css
-------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------
 190 | ERROR | [x] Multiple selectors should each be on a single line
 933 | ERROR | [x] Multiple selectors should each be on a single line
 933 | ERROR | [x] Multiple selectors should each be on a single line
 933 | ERROR | [x] Multiple selectors should each be on a single line
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------

FILE: ./himalaya/himalaya.theme
-------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------
  1 | ERROR | [x] Missing file doc comment
  5 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 16 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------

FILE: ./himalaya/js/custom.js
-------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
-------------------------------------------------------------------------
  6 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  8 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  9 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 22 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 23 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 25 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 26 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 28 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------
📌 Task
Status

Needs work

Version

5.0

Component

Code

Created by

🇵🇭Philippines paraderojether

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.

Sign in to follow issues

Comments & Activities

  • Issue created by @paraderojether
  • @paraderojether opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇵🇭Philippines paraderojether

    Created an MR to fix the issues reported by phpcs.

    Please review.
    Thank You.

  • Assigned to dineshkumarbollu
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India dineshkumarbollu

    Hi

    MR!7 is still some issues,

    I will work on it.
    Thanks

    vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/himalaya-3361378/

    FILE: /var/www/html/vbd9/web/modules/contrib/himalaya-3361378/himalaya.info.yml
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 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
    -------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vbd9/web/modules/contrib/himalaya-3361378/templates/html.html.twig
    --------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------
    51 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------

    Time: 456ms; Memory: 16MB

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The report shows errors/warnings for three files, but the MR changes five files.

  • Status changed to Needs review over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The complete report shows five files to be changed; therefore, the MR is not changing more files that is should.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    (Never mind: the 6.0.1 branch has been merged in the 8.x-5.x branch; that is the branch that needs to be fixed.)

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    For the .info.yml file, there is already 📌 Remove the "version" key from the .info.yml file RTBC .

  • First commit to issue fork.
  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama India

    No errors/warning remaining.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The MR changes a .twig file, which is not included in the report, and it does not change the js/custom.js file for which the report shows warnings/errors.

Production build 0.71.5 2024