Fix the issues reported by phpcs

Created on 20 April 2023, over 1 year ago
Updated 21 August 2024, 3 months ago
๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia chanderbhushan

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

Merge Requests

Comments & Activities

  • Issue created by @chanderbhushan
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chanderbhushan

    Added patch for fix these issues.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Jaspreet-Kaur

    Reviewed ! Patch #2 patch fixed all the coding standard issues.

  • Issue was unassigned.
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia keshavv India

    Reviewed the patch and tested locally. We can merge it.
    Moving to RTBC

  • 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 has been used, which arguments have been used, and which report that command shown.

    +/**
    + * @file
    + */
    +

    The short description is missing. That is required from the @file tag.

     /**
    - * LayoutBuilder
    + * LayoutBuilder.
      */
     class NorenderLayoutBuilder implements TrustedCallbackInterface {
     

    The class description is just repeating the class name. Adding a period does not change that.

    +   *   Element
        * @param $element
    +   *
    +   *   Return array
    +   *
        * @return array

    @param must be put before the parameter description and @return before the return value description.
    Those descriptions are not sufficient.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad

    Issue summary updated.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mrinalini9 New Delhi

    Updated patch #2 by addressing #7, please review it.

    Thanks!

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @mrinalini9,

    I reviewed the changes and confirmed the Patch#9 was applied cleanly to the Layout Builder No-render module against 1.0.0 on Drupal 9.5.10.

    Checking patch layout_builder_norender.info.yml...
    Checking patch layout_builder_norender.module...
    Checking patch src/Element/NorenderLayoutBuilder.php...
    Checking patch src/EventSubscriber/SectionComponentNorender.php...
    Applied patch layout_builder_norender.info.yml cleanly.
    Applied patch layout_builder_norender.module cleanly.
    Applied patch src/Element/NorenderLayoutBuilder.php cleanly.
    Applied patch src/EventSubscriber/SectionComponentNorender.php cleanly.

    However, the Patch didn't fix the PHPCS errors:

    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/layout_builder_norender-3355278/css/norender.css
    ----------------------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 5 LINES
    ----------------------------------------------------------------------------------------------------------------------------
     34 | ERROR | [x] CSS colours must be defined in lowercase; expected #ff0000ff but found #FF0000FF
     44 | ERROR | [x] CSS colours must be defined in lowercase; expected #ff0000ff but found #FF0000FF
     47 | ERROR | [x] Blank lines are not allowed in class definitions
     69 | ERROR | [x] CSS colours must be defined in lowercase; expected #ff0000ff but found #FF0000FF
     70 | ERROR | [x] CSS colours must be defined in lowercase; expected #ff0000ff but found #FF0000FF
    ----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/layout_builder_norender-3355278/README.md
    ---------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 6 WARNINGS AFFECTING 7 LINES
    ---------------------------------------------------------------------------------------------------------------------
     17 | WARNING | [ ] Line exceeds 80 characters; contains 132 characters
     18 | WARNING | [ ] Line exceeds 80 characters; contains 135 characters
     21 | WARNING | [ ] Line exceeds 80 characters; contains 123 characters
     22 | WARNING | [ ] Line exceeds 80 characters; contains 123 characters
     23 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
     34 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
     44 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    ---------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/layout_builder_norender-3355278/src/Element/NorenderLayoutBuilder.php
    -------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------
     28 | ERROR | Type hint "array" missing for $element
    -------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/layout_builder_norender-3355278/src/Controller/NorenderBlockController.php
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------------------
     49 | ERROR | Missing parameter type
     51 | ERROR | Missing parameter type
     53 | ERROR | Missing parameter type
     56 | ERROR | Description for the @return value is missing
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/layout_builder_norender-3355278/src/EventSubscriber/SectionComponentNorender.php
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
     25 | ERROR   | [ ] The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
     30 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
     58 | ERROR   | [x] Array closing indentation error, expected 10 spaces but found 12
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 105ms; Memory: 10MB

    Moving this now to Needs work for investigations.

    Thank you!

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Hi,

    I applied the MR !12 and I noticed that there are still PHPCS issues that needs to resolved.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/layout_builder_norender (1.0.x)
    $ curl https://git.drupalcode.org/project/layout_builder_norender/-/merge_requests/3.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5895    0  5895    0     0  15543      0 --:--:-- --:--:-- --:--:-- 15595
    patching file README.md
    patching file css/norender.css
    patching file layout_builder_norender.info.yml
    patching file layout_builder_norender.module
    patching file src/Element/NorenderLayoutBuilder.php
    patching file src/EventSubscriber/SectionComponentNorender.php
    
    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib
    $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml layout_builder_norender/
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\layout_builder_norender\src\Controller\NorenderBlockController.php
    -----------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    -----------------------------------------------------------------------------------------------------------------------------------
     49 | ERROR | Missing parameter type
     51 | ERROR | Missing parameter type
     53 | ERROR | Missing parameter type
     56 | ERROR | Description for the @return value is missing
    -----------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\layout_builder_norender\src\EventSubscriber\SectionComponentNorender.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
     25 | ERROR   | The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
     30 | WARNING | Line exceeds 80 characters; contains 100 characters
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 252ms; Memory: 10MB
    
  • Venkatraman Ganesan โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohd sahzad

    I have fixed this issue in attached patch #10

  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi,

    I have applied the latest MR !3 from comment #14 to the Layout Builder Publish/UnPublish module with the 1.0.0 version on Drupal 10 and confirmed all PHPCS errors have been fixed.

    I ran this command on the module:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml layout_builder_norender/

    Please see the attached file for reference.

    I'm moving this now to โ€˜RTBCโ€™.

    Thank you!

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

    avpaderno โ†’ changed the visibility of the branch 3355278-gitlab-ci-reports to hidden.

Production build 0.71.5 2024