Drupal Coding Standards Issues | phpcs

Created on 15 June 2023, about 1 year ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\slick\slick.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\slick\slick.module
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
21 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "slick" but expected "slick_slick"
---------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run following command:

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

Proposed resolution

Above error/warnings need to be fixed

💬 Support request
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇮🇳India arti_parmar

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

Comments & Activities

  • Issue created by @arti_parmar
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    19 pass
  • 🇮🇳India arti_parmar

    Kindly review patch.

  • Status changed to Closed: duplicate about 1 year ago
  • 🇮🇩Indonesia gausarts

    Please always check out for dups beforehand to avoid inconvenience.

    Drupal kindly gives us a searchbox and already warned us to use it. That would be very much helpful for us both if you consider using it.

    I am fine with support dups, but honestly not a big fan of patch dups :)

    I will write it here a bit more comprehensive to point other dups to for these particular issues.

    1. Regarding version. You didn't read the warnings there. You removed what the tools told you without even removing the leftover warnings. The warnings said we should remove it. It agreed with you. But only after the mentioned problems resolved. You just need to understand the written problems there.
    2. Regarding slick_slick(). IMHO, slick() is a ridiculously unique function name. It can't be more ridiculous like slick_slick(). That rule is certainly a must for non-unique or meaningful or potentially conflicting or reserved names like goto, list, filter, or more here https://www.php.net/manual/en/reserved.keywords.php which might conflict with upstream potential function names. Rest assured, we can always change it later when PHP authorities mistakenly take over that stupid name, but certainly not now, or in the near future. I am positively sure they are great mind people who would consider taking function names very seriously, not ridiculously. Also did you consider about the entire ecosystem integrity for this change, including my custom modules?

    A fine line between paranoia and insanity is common sense. We should consider using it sometimes.

    Please also close your dup issues.

    Thank you for kind considerations.

Production build 0.69.0 2024