Coding Standard Issues

Created on 5 September 2024, 4 months ago

Problem/Motivation

Drupal Coding standards should be fixed.

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

FILE: ...ome/aly/www/contribuciones/web/modules/custom/view_password/config/schema/view_password.schema.yml
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
16 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

FILE: .../aly/www/contribuciones/web/modules/custom/view_password/config/install/view_password.settings.yml
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/view_password/view_password.module
--------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
51 | ERROR | [x] Inline comments must start with a capital letter
51 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or
| | closing parentheses
56 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/view_password/README.md
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
49 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: .../web/modules/custom/view_password/src/Form/PasswordSettingsForm.php
--------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------------
49 | WARNING | [ ] Only string literals should be passed to t() where possible
50 | ERROR | [x] Short array syntax must be used to define arrays
50 | ERROR | [ ] The array declaration extends to column 97 (the limit is 80). The array content
| | should be split up over multiple lines
57 | WARNING | [ ] Only string literals should be passed to t() where possible
58 | ERROR | [x] Short array syntax must be used to define arrays
58 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content
| | should be split up over multiple lines
100 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
107 | ERROR | [x] Expected 1 blank line after function; 2 found
117 | ERROR | [x] Expected 1 blank line after function; 2 found
120 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/view_password/view_password.libraries.yml
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
15 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/view_password/CHANGELOG.txt
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
---------------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 90 characters
7 | WARNING | Line exceeds 80 characters; contains 99 characters
16 | WARNING | Line exceeds 80 characters; contains 128 characters
25 | WARNING | Line exceeds 80 characters; contains 113 characters
26 | WARNING | Line exceeds 80 characters; contains 98 characters
27 | WARNING | Line exceeds 80 characters; contains 109 characters
---------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

6.0

Component

Code

Created by

🇵🇪Peru alyaj2a

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

Merge Requests

Comments & Activities

  • Issue created by @alyaj2a
  • Assigned to dharmeshbarot89
  • Issue was unassigned.
  • Needs review,
    created MR for resolving phpcs issues.

  • Status changed to Needs review 4 months ago
  • Status changed to Needs work 4 months ago
  • 🇵🇭Philippines paraderojether

    Hi dharmeshbarot89,

    I reviewed MR!22, and there is still 1 warning remaining shown below:

    ➜  view_password git:(6.0.x) curl https://git.drupalcode.org/project/view_password/-/merge_requests/22.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  7774    0  7774    0     0   4335      0 --:--:--  0:00:01 --:--:--  4350
    patching file CHANGELOG.txt
    patching file README.md
    patching file 'config/install/view_password.settings.yml'
    patching file 'config/schema/view_password.schema.yml'
    patching file 'src/Form/PasswordSettingsForm.php'
    patching file view_password.libraries.yml
    patching file view_password.module
    ➜  view_password git:(6.0.x) ✗ cd ..
    ➜  contrib git:(1.0.0) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig view_password
    
    FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/view_password/src/Form/PasswordSettingsForm.php
    ---------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------
     45 | WARNING | Unused variable $trailing_slash_message.
    ---------------------------------------------------------------------------------------------------------------------------------
    
    Time: 116ms; Memory: 10MB
    

    Thank you.

  • Assigned to amit.rawat777
  • 🇮🇳India amit.rawat777

    working on it

  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • 🇮🇳India amit.rawat777

    I have fixed the remaining issues

    • f6eb4a9e committed on 6.0.x
      Issue #3472457 by alyaj2a, dharmeshbarot89, amit.rawat777,...
  • 🇩🇪Germany anacolautti

    Thank you all. I merged your changes, from the MR and the patch, and fixed a few dangling spaces and missing new lines.

    This is on dev already.

  • Status changed to Fixed about 1 month ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024