Fix the issues reported by phpcs

Created on 21 April 2023, over 1 year ago
Updated 28 February 2024, 9 months ago

Command and arguments used is:-
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/custom/user_created_by

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/user_created_by/user_created_by.views.inc
------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------
31 | ERROR | [x] Short array syntax must be used to define arrays
34 | ERROR | [x] Short array syntax must be used to define arrays
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/user_created_by/README.txt
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
35 | WARNING | Line exceeds 80 characters; contains 86 characters
---------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/user_created_by/user_created_by.module
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
17 | ERROR | [x] Short array syntax must be used to define arrays
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------

Time: 90ms; Memory: 10MB

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇳India dineshkumarbollu

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

  • Issue created by @dineshkumarbollu
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Ashutosh Ahirwal India

    I have updated the issue description and also added command and arguments used.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines clarkssquared

    Hi dineshkumarbollu

    I applied your patch #2 to my local and I confirmed that your patch fixed PHPCS issues, however below are the remaining PHPCS issues that displays in my terminal

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/user_created_by/user_created_by.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: 270ms; Memory: 8MB

    Please also look at the screenshot attached for your reference.

    Moving this to needs work to hear from you and even the maintainer if this issue should be fixed or not.

    Thanks.

  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama India

    @clarkssquared can you tell which command are you using? Since, i'm not getting any errors/warning after applying patch #2 on branch 2.x

  • 🇵🇭Philippines clarkssquared

    Hi nitin_lama

    I executed the command below

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

    based on my observation the issue that I raised will occur if the module is downloaded via composer, if you download the git repo the error that I commented will not appear. I only moved this ticket to needs work to get the attention of the maintainer or even the patch/MR owner if the issue should be fixed or if it can be ignored.

  • Issue was unassigned.
  • Assigned to thakurnishant_06
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Hello @clarkssquared,
    Created an updated patch to fix the remaining issues after applying patch #2 . Please review the patch.
    adding screenshot of error after applying patch #2 for reference.
    Thank You.

  • 🇮🇳India Yashaswi18

    Tried applying above patch, got this error:

    Checking patch README.txt...
    Checking patch user_created_by.info.yml...
    error: while searching for:
    core_version_requirement: ^8 || ^9
    dependencies:
     - drupal:views
    
    # Information added by Drupal.org packaging script on 2021-11-03
    version: '2.0.0'
    project: 'user_created_by'
    datestamp: 1635952656
    
    error: patch failed: user_created_by.info.yml:5
    error: user_created_by.info.yml: patch does not apply
    Checking patch user_created_by.module...
    Checking patch user_created_by.views.inc...
Production build 0.71.5 2024