Fix the issues reported by PHP_CodeSniffer

Created on 28 September 2024, 6 months ago

Problem/Motivation

FILE: modules\user_logout_shortcut\css\user-logout.css
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
24 | ERROR | [x] Each style definition must be on a line by itself
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: modules\user_logout_shortcut\README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------
18 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
31 | WARNING | [ ] Line exceeds 80 characters; contains 132 characters
40 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
41 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
47 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
56 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: modules\user_logout_shortcut\src\Controller\UserLogoutShortcutController.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Logger\LoggerChannelFactoryInterface.
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

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

Merge Requests

Comments & Activities

  • Issue created by @sunil jolapara
  • šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary for PHP_CodeSniffer issues should always show the report given from PHP_CodeSniffer and the arguments passed to phpcs.

  • šŸ‡µšŸ‡­Philippines cleavinjosh
  • šŸ‡µšŸ‡­Philippines cleavinjosh
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @sunil jolapara,

    Thank you for providing an MR. I applied MR!1, it was applied smoothly and fixed all the phpcs issues.

    āžœ  user_logout_shortcut git:(1.0.x) curl https://git.drupalcode.org/project/user_logout_shortcut/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2825    0  2825    0     0   3888      0 --:--:-- --:--:-- --:--:--  3885
    patching file README.md
    patching file css/user-logout.css
    patching file src/Controller/UserLogoutShortcutController.php
    āžœ  user_logout_shortcut git:(1.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml user_logout_shortcut
    āžœ  contrib git:(main) āœ—

    Thank you.

  • Pipeline finished with Success
    5 months ago
    Total: 136s
    #346949
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    cleavinjosh ā†’ changed the visibility of the branch 3477525-phpcs-issues to hidden.

  • Pipeline finished with Success
    5 months ago
    Total: 138s
    #346955
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    4 months ago
    Total: 146s
    #353104
  • Pipeline finished with Success
    4 months ago
    Total: 427s
    #353097
  • Issue was unassigned.
  • Status changed to Needs review 4 months ago
  • šŸ‡®šŸ‡³India chandansha

    I have tested MR 1 using @cleavinjosh given command i find below issue.

    FILE: /home/chandansha/docker/d9contro/web/modules/custom/user_logout_shortcut-3477525/README.md
    ------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------
     18 | WARNING | Line exceeds 80 characters; contains 93 characters
    ------------------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/d9contro/web/modules/custom/user_logout_shortcut-3477525/css/user-logout.css
    ----------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------
     24 | ERROR | [x] Each style definition must be on a line by itself
    ----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------
    
    Time: 65ms; Memory: 10MB
    

    i move it to Need Work
    Thanks!!

  • šŸ‡®šŸ‡³India kulpratap2002

    Gitlab CI does not report issues for the README.md file and see #12 @avpaderno told that these changes not required by gitlab ci.

  • šŸ‡®šŸ‡³India chandansha

    @kul.pratap Thanks For pin I have tested it on my local. Now if we have to check only pipeline then its successfully pass.
    I move it to RTBC
    Thanks!!

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The only file with PHP_CodeSniffer errors is the src/Controller/UserLogoutShortcutController.php file. The merge request changes two files instead of one.

    Furthermore, the existing branch is no longer supported. Before doing any change, either the branch should be changed to require a supported Drupal core version, or a new branch should be created for a supported Drupal core version.

Production build 0.71.5 2024