Coding Standard issues

Created on 12 September 2024, 2 months ago
Updated 16 September 2024, 2 months ago

Problem/Motivation

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

FILE: .../web/modules/custom/pcr/src/Plugin/better_exposed_filters/filter/PrettyCheckboxesRadios.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\RadioButtons.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/pcr/pcr.module
------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Routing\RouteMatchInterface.
44 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

2.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
  • Assigned to alyaj2a
  • Merge request !5Coding Standard issues - #3474014 ā†’ (Open) created by alyaj2a
  • Pipeline finished with Success
    2 months ago
    Total: 397s
    #281615
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • Status changed to RTBC 2 months ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi,

    I reviewed MR!5, applied it against PCR 2.0.x-dev and confirmed it fixes the issues reported by phpcs.

     contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig pcr
    
    FILE: /Users/jetherparadero/Q4/q4contributions/web/modules/contrib/pcr/pcr.module
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------------------------------------------
      1 | ERROR   | [x] Missing file doc comment
     11 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Routing\RouteMatchInterface.
     44 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
    ------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/jetherparadero/Q4/q4contributions/web/modules/contrib/pcr/src/Plugin/better_exposed_filters/filter/PrettyCheckboxesRadios.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\RadioButtons.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 338ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ— cd pcr
    āžœ  pcr git:(2.0.x) curl https://git.drupalcode.org/project/pcr/-/merge_requests/5.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1436    0  1436    0     0   3388      0 --:--:-- --:--:-- --:--:--  3443
    patching file pcr.module
    patching file 'src/Plugin/better_exposed_filters/filter/PrettyCheckboxesRadios.php'
    āžœ  pcr git:(2.0.x) āœ— cd ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig pcr
    āžœ  contrib git:(main) āœ—

    It is also passed on the on the Gitlab CI https://git.drupalcode.org/issue/pcr-3474014/-/jobs/2734627.

    Thank you.

Production build 0.71.5 2024