Coding Standard Issues

Created on 5 September 2024, 8 days ago
Updated 12 September 2024, 1 day ago

Problem/Motivation

Drupal Coding standards should be fixed.

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .

FILE: .../web/modules/custom/views_slideshow/README.md
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------
63 | WARNING | Line exceeds 80 characters; contains 87 characters
82 | WARNING | Line exceeds 80 characters; contains 93 characters
84 | WARNING | Line exceeds 80 characters; contains 93 characters
87 | WARNING | Line exceeds 80 characters; contains 96 characters
88 | WARNING | Line exceeds 80 characters; contains 161 characters
89 | WARNING | Line exceeds 80 characters; contains 128 characters
90 | WARNING | Line exceeds 80 characters; contains 127 characters
-------------------------------------------------------------------------------

FILE: .../web/modules/custom/views_slideshow/src/Plugin/ViewsSlideshowWidgetType/Controls.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
77 | ERROR | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/views_slideshow/src/Plugin/ViewsSlideshowWidgetType/Pager.php
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
102 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Needs work

Version

5.0

Component

Code

Created by

šŸ‡µšŸ‡ŖPeru alyaj2a

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @alyaj2a
  • Merge request !12Coding Standard Issues - #3472351 ā†’ (Open) created by alyaj2a
  • Status changed to Needs review 8 days ago
  • Status changed to Needs work 1 day ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @alyaj2a,

    Thank you for providing an MR. I applied MR!12, 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:

    āžœ  views_slideshow git:(5.0.x) curl https://git.drupalcode.org/project/views_slideshow/-/merge_requests/12.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3786    0  3786    0     0   7889      0 --:--:-- --:--:-- --:--:--  7903
    patching file README.md
    patching file src/Plugin/ViewsSlideshowWidgetType/Controls.php
    patching file src/Plugin/ViewsSlideshowWidgetType/Pager.php
    āžœ  views_slideshow git:(5.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml views_slideshow
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/views_slideshow/tests/src/Functional/Plugin/StyleSlideshowTest.php
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Tests\views\Functional\ViewTestBase.
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/views_slideshow/modules/views_slideshow_cycle/views_slideshow_cycle.module
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Routing\RouteMatchInterface.
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...sers/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/views_slideshow/modules/views_slideshow_cycle/src/Plugin/ViewsSlideshowType/Cycle.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Link.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/views_slideshow/modules/views_slideshow_cycle/src/Commands/ViewsSlideshowCycleCommands.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     3 | ERROR | [x] Expected strict_types=1, found strict_types = 1.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/views_slideshow/src/Plugin/views/style/Slideshow.php
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 882ms; Memory: 14MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

Production build 0.71.5 2024