Fix the issues reported by PHP_CodeSniffer

Created on 21 September 2024, 11 months ago

Problem/Motivation

FILE: revision_assignee\README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
12 | WARNING | Line exceeds 80 characters; contains 85 characters
13 | WARNING | Line exceeds 80 characters; contains 89 characters
----------------------------------------------------------------------

FILE: revision_assignee\revision_assignee.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: revision_assignee\revision_assignee.install
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: revision_assignee\revision_assignee.module
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

FILE: revision_assignee\revision_assignee.services.yml
-----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
13 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------

FILE: revision_assignee\src\EventSubscriber\EntitySchemaSubscriber.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------
56 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
94 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: revision_assignee\src\Utility\RevisionAssigneeUtility.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
25 | WARNING | [x] 'todo maybe make the field configurable...' should match the format '@todo Fix problem X here.'
--------------------------------------------------------------------------------------------------------------------
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 review

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
  • Status changed to Needs review 11 months ago
  • šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I checked and applied MR !1 and these are the remaining reported PHPCS issues

    āžœ  revision_assignee git:(main) āœ— curl https://git.drupalcode.org/project/revision_assignee/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3989    0  3989    0     0   8286      0 --:--:-- --:--:-- --:--:--  8415
    patching file README.txt
    patching file revision_assignee.install
    patching file revision_assignee.module
    patching file revision_assignee.services.yml
    patching file 'src/EventSubscriber/EntitySchemaSubscriber.php'
    patching file 'src/Utility/RevisionAssigneeUtility.php'
    āžœ  revision_assignee git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml revision_assignee 
    
    FILE: ...pal_local/web/modules/contrib/revision_assignee/revision_assignee.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: .../modules/contrib/revision_assignee/src/Utility/RevisionAssigneeUtility.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     43 | WARNING | t() calls should be avoided in classes, use
        |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         | $this->t() instead
     44 | WARNING | t() calls should be avoided in classes, use
        |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         | $this->t() instead
    --------------------------------------------------------------------------------
    
    Time: 277ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ— 
    
  • šŸ‡®šŸ‡¹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.

    Furthermore, since GitLab CI is now enabled for all the projects, GitLab CI should be used to get PHP_CodeSniffer errors/warnings.

Production build 0.71.5 2024