Drupal Coding Standards Issues | phpcs

Created on 4 January 2023, almost 2 years ago
Updated 9 January 2024, 11 months ago

Problem/Motivation

Time: 436ms; Memory: 8MB

FVHW6HFRJ1WK:~ sahil.goyal$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /Applications/MAMP/htdocs/10.1.x/drupal/modules/contrib/layout_builder_styles

FILE: /Applications/MAMP/htdocs/10.1.x/drupal/modules/contrib/layout_builder_styles/layout_builder_styles.links.menu.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/10.1.x/drupal/modules/contrib/layout_builder_styles/layout_builder_styles.links.action.yml
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/10.1.x/drupal/modules/contrib/layout_builder_styles/layout_builder_styles.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: /Applications/MAMP/htdocs/10.1.x/drupal/modules/contrib/layout_builder_styles/layout_builder_styles.module
----------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 3 WARNINGS AFFECTING 9 LINES
----------------------------------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
192 | ERROR | [x] Expected 1 space after IF keyword; 0 found
204 | WARNING | [ ] Only string literals should be passed to t() where possible
215 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
224 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
231 | ERROR | [x] Use "elseif" in place of "else if"
243 | ERROR | [x] Expected 1 blank line after function; 2 found
309 | ERROR | [x] Doc comment long description must end with a full stop
321 | ERROR | [x] Expected newline after closing brace
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India sahil.goyal

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 5.3 & MySQL 5.5
    last update over 1 year ago
    Composer error. Unable to continue.
  • 🇮🇳India Shreya_98

    Review this patch file.

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States Webbeh Georgia, USA

    What's the dif between comment #2? Is there one?

    NW because I suspect a drive-by patch effort rather than building off the work done in the issue thus far.

  • 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    Fix The All PHPCS Issues generated by Drupal coding standard
    I used The Following the CMD :- ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/layout_builder_styles
    Added The InterDiff File Between the #8 to #5.

  • Status changed to Needs review 11 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 5.3 & MySQL 5.5
    last update 11 months ago
    Patch Failed to Apply
  • 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
  • Status changed to Needs work 11 months ago
  • 🇷🇺Russia zniki.ru

    Patch file #8 is emtpy.

  • 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    Updated patch File ..

  • Status changed to Needs review 11 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 5.3 & MySQL 5.5
    last update 11 months ago
    Composer error. Unable to continue.
  • 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
  • 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
  • 🇮🇳India zkhan.aamir

    Hi,

    Patch #11 applied cleanly resolving all the errors.
    Still there are 3 warnings remaining.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/layout_builder_styles
    $ curl https://www.drupal.org/files/issues/2023-12-20/3331022-8_1.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 12915  100 12915    0     0   216k      0 --:--:-- --:--:-- --:--:--  221k
    patching file layout_builder_styles.install
    patching file layout_builder_styles.links.action.yml
    patching file layout_builder_styles.links.menu.yml
    patching file layout_builder_styles.module
    patching file layout_builder_styles.post_update.php
    patching file src/EventSubscriber/BlockComponentRenderArraySubscriber.php
    patching file src/Form/LayoutBuilderStyleForm.php
    patching file tests/src/Functional/LayoutBuilderStyleGroupTest.php
    patching file tests/src/Functional/LayoutBuilderStyleRestrictionsTest.php
    patching file tests/src/Functional/LayoutBuilderStyleTest.php
    
    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/layout_builder_styles
    $ cd ../
    
    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib
    $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml layout_builder_styles/
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\layout_builder_styles\layout_builder_styles.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
    ---------------------------------------------------------------------------------------------------------------------
    
    Time: 868ms; Memory: 12MB
    
    
  • Status changed to Needs work 11 months ago
  • 🇺🇸United States Webbeh Georgia, USA

    This issue is a mess given the lack of collaboration. I recommend closing this and fixing it internally.

Production build 0.71.5 2024