Fix the issues reported by phpcs

Created on 9 May 2023, over 1 year ago
Updated 7 November 2023, about 1 year ago

Problem/Motivation

โฏ phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js .

FILE: /Users/specbee/Sites/Projects/pantheon_secrets/docs/example.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 12 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------
  9 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
 15 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
 18 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
 27 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 30 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 37 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
 44 | WARNING | [ ] Line exceeds 80 characters; contains 214 characters
 48 | WARNING | [ ] Line exceeds 80 characters; contains 138 characters
 54 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 61 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
 65 | WARNING | [ ] Line exceeds 80 characters; contains 125 characters
 67 | WARNING | [ ] Line exceeds 80 characters; contains 135 characters
 71 | ERROR   | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/pantheon_secrets/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
 40 | WARNING | Line exceeds 80 characters; contains 89 characters
 47 | WARNING | Line exceeds 80 characters; contains 86 characters
 49 | WARNING | Line exceeds 80 characters; contains 107 characters
 51 | WARNING | Line exceeds 80 characters; contains 119 characters
 53 | WARNING | Line exceeds 80 characters; contains 129 characters
 54 | WARNING | Line exceeds 80 characters; contains 138 characters
 55 | WARNING | Line exceeds 80 characters; contains 84 characters
----------------------------------------------------------------------

Time: 176ms; Memory: 10MB

Steps to reproduce

Run following command
phpcs --standard=โ€œDrupal,DrupalPracticeโ€ --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js .

๐Ÿ“Œ Task
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu_jhaloya Indore

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 @himanshu_jhaloya
  • @himanshu_jhaloya opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines kenyoOwen

    Hi himanshu_jhaloya

    I applied your MR to the โ€œPantheon Secretsโ€ module and confirmed that the phpcs mentioned are resolved and the remaining warnings is for the maintainer if it needs to be fixed. Please see the screenshots attached.

    For your review.
    Thank you.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
         ```
    -    terminus drush <site>.<env> -- en -y pantheon_secrets sendgrid_api sendgrid_mailer
    +    terminus drush <site>.<env> -- en -y pantheon_secrets 
    +    sendgrid_api sendgrid_mailer
         ```

    Commands shown in .md files must be formatted to make clear it is the same command, not two different commands.

    The report shows also warnings/errors for the pantheon_secrets.info.yml file, but the MR does not change that file.

  • Assigned to imustakim
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada imustakim Canada
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada imustakim Canada
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada imustakim Canada

    Patch Updated.
    Please review.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
         ```
    -    terminus secret:set <site> --scope=web --type=runtime <secret_name> <secret_value>
    +    terminus secret:set <site> --scope=web --type=runtime 
    +    <secret_name> <secret_value>
         ```

    Commands shown in .md files must be formatted to make clear it is the same command, not two different commands.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada imustakim Canada

    Fixed the command in .md file, it shows line exceed error, assuming this can be ignored as the command line shoud be a one line.
    Patch updated, please review.

  • Status changed to Active about 1 year ago
  • This is being tracked internally as BUGS-6956.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Since there is a patch to review, the correct status is Needs review.

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mrinalini9 New Delhi

    Hi,

    I have reviewed patch #10, it applied, but threw some trailing whitespace issues at the time of applying the patch:

    3359008-10.patch:30: trailing whitespace.
        1) Add a new key through the Key module UI. Select Pantheon Secret as 
    3359008-10.patch:32: trailing whitespace.
        1) Go to /admin/config/system/keys/pantheon and click on the "Sync Keys" 
    3359008-10.patch:34: trailing whitespace.
        1) Use the provided drush command to sync all of your secrets 
    3359008-10.patch:48: trailing whitespace.
    1) Make sure you have access to a Drupal >= 9.4 site running PHP >= 8.0 
    3359008-10.patch:56: trailing whitespace.
    1) Install the required modules in your Drupal site and push the 
    warning: squelched 9 whitespace errors
    warning: 14 lines add whitespace errors.
    

    Also, it fixed all the phpcs issues as reported, except this one:

    FILE: /pantheon_secrets/README.md
    -----------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------
     48 | WARNING | Line exceeds 80 characters; contains 86 characters
    -----------------------------------------------------------------------------------
    

    Please fix all these issues.

    Thanks & Regards,
    Mrinalini

  • Assigned to Gautam_105@
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gautam_105@

    @mrinalini9,
    i have fixed this and created MR for the same. Please review and see screenshot as well

  • Issue was unassigned.
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Closed: works as designed about 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ทCosta Rica kporras07

    Thanks for your contributions.

    Although I love coding standard; this is only docs files and I don't see a lot of value in following standards in MD files where I prefer readability over standards.

    I'm going to close this issue as works as designed.

Production build 0.71.5 2024