Fix the issues reported by phpcs

Created on 6 July 2023, over 1 year ago
Updated 31 May 2024, 6 months ago
๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • Hello, @urvashi_vora thanks for the patch, I have applied your patch and ran successfully.

    These are the steps I followed:

    1. Took clone from git version 1.0.x in drupal 10.1.x

    2. Ran this command:

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,m
    d,yml,twig modules/contrib/config_track/

    3. Applied your patch and, again ran phpcs command

    found errors

    4. I have fixed that error with phpcbf.

    Ran this command to fix the errors:

    ./vendor/bin/phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,m
    d,yml,twig modules/contrib/config_track/
    Then again checked with phpcs:

    again ran phpcs command

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,m
    d,yml,twig modules/contrib/config_track/

    found no errors.

    Please review.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aayushDrupal

    aayushmankotia โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aayushDrupal

    Hi @Satish_kumar

    I have created a patch to address all the PHP coding standard issues. Please review.

  • Status changed to Needs work 6 months ago
  • Hi @aayushmankotia,

    Applied patch #3, some of the files of the patch did not apply successfully, might be the reason the errors below was thrown.

    config_track git:(1.0.x) curl https://www.drupal.org/files/issues/2023-09-05/fixed_issue_3372832-3.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 17682  100 17682    0     0   8751      0  0:00:02  0:00:02 --:--:--  8792
    patching file README.md
    patching file config_track.info.yml
    patching file config_track.install
    patching file config_track.module
    Hunk #2 FAILED at 17.
    Hunk #3 succeeded at 39 (offset -1 lines).
    Hunk #4 succeeded at 48 (offset -1 lines).
    Hunk #5 succeeded at 72 (offset -1 lines).
    Hunk #6 succeeded at 95 (offset -1 lines).
    Hunk #7 succeeded at 122 (offset -1 lines).
    Hunk #8 succeeded at 174 (offset -1 lines).
    1 out of 8 hunks FAILED -- saving rejects to file config_track.module.rej
    patching file src/Config/ConfigTrackLanguageConfigOverride.php
    patching file src/Controller/ConfigTrackController.php
    patching file src/EventSubscriber/ConfigTrackSubscriber.php
    patching file src/Extension/ModuleHandler.php
    โžœ  config_track git:(1.0.x) โœ— cd ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig config_track
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/config_track/config_track.module
    ---------------------------------------------------------------------------------------------------------
    FOUND 12 ERRORS AFFECTING 12 LINES
    ---------------------------------------------------------------------------------------------------------
      20 | ERROR | [x] Trailing punctuation for @see references is not allowed.
      23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
      24 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      26 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      27 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
      28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      31 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      32 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
      33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
     257 | ERROR | [ ] Description for the @return value is missing
    ---------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------
    
    Time: 448ms; Memory: 12MB

    Kindly check,
    Jake

Production build 0.71.5 2024