Fix the issues reported by phpcs

Created on 5 April 2023, over 1 year ago
Updated 24 May 2024, 7 months ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/quick_links/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
70 | WARNING | Line exceeds 80 characters; contains 89 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/quick_links/modules/quick_links_olivero/quick_links_olivero.module
------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
13 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------

Time: 1.07 secs; Memory: 6MB

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed.

šŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India samit.310@gmail.com

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 @samit.310@gmail.com
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India samit.310@gmail.com

    Above errors/warnings has been fixed.

  • Assigned to akshaydalvi212
  • šŸ‡®šŸ‡³India akshaydalvi212

    i will review the patch #2.

  • Issue was unassigned.
  • šŸ‡®šŸ‡³India akshaydalvi212

    Patch #2 solves the issues mentioned above.
    but, having a similar function doc comment is not valid in the 'quick_links_olivero.module' file.
    hence updating the doc comment and providing the patch with interdiff file for reference.
    kindly review.

  • Hi, reviewed the patch #4, applied cleanly and fixes all the phpcs errors/warnings.

  • Status changed to RTBC 7 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @akshaydalvi212,

    As stated by @bindu r, patch #4 fixed all issues found by phpcs.

    I also applied patch #4, it was applied smoothly and I don't see any issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml on my end as well.

    āžœ  quick_links git:(2.0.x) curl https://www.drupal.org/files/issues/2023-04-05/3352283-4.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1328  100  1328    0     0   2407      0 --:--:-- --:--:-- --:--:--  2410
    patching file README.md
    patching file modules/quick_links_olivero/quick_links_olivero.module
    āžœ  quick_links git:(2.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml quick_links
    āžœ  contrib git:(main) āœ—

    Thank you.

Production build 0.71.5 2024