Fix the issues reported by phpcs

Created on 11 July 2023, over 1 year ago
Updated 5 October 2023, about 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/lpl/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
25 | WARNING | Line exceeds 80 characters; contains 89 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/lpl/lpl.module
--------------------------------------------------------------------------------------
FOUND 18 ERRORS AND 1 WARNING AFFECTING 17 LINES
--------------------------------------------------------------------------------------
6 | ERROR | [x] There must be exactly one blank line after the file comment
14 | ERROR | [x] Inline comments must start with a capital letter
14 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
21 | ERROR | [x] Inline comments must start with a capital letter
28 | ERROR | [x] Inline comments must start with a capital letter
35 | ERROR | [x] Inline comments must start with a capital letter
41 | ERROR | [x] Inline comments must start with a capital letter
68 | ERROR | [x] Inline comments must start with a capital letter
68 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
70 | WARNING | [ ] Unused variable $language_entities.
73 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
74 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
76 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
77 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
78 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 8
79 | ERROR | [x] Closing brace indented incorrectly; expected 6 spaces, found 8
80 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces, found 6
81 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 4
100 | ERROR | [ ] Invalid function name, expected validate_path but found
| | validatePath
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

Time: 105ms; Memory: 10MB

Steps to reproduce

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

Remaining tasks

Patch review

📌 Task
Status

Fixed

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
  • Status changed to Needs work about 1 year ago
  • 🇮🇳India ashutosh ahirwal India

    I reviewed the provided patch.
    There are some remaining error too after patch get applied cleanly.
    Need to fix them too.
    Moving to Need Works.

    Used command:-
    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/lpl

    Remaining issues
    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/lpl/lpl.module
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    68 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "logo_per_language_validate" but expected "lpl_logo_per_language_validate"
    101 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "validate_path" but expected "lpl_validate_path"
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Time: 106ms; Memory: 10MB

  • Status changed to Needs review about 1 year ago
  • 🇮🇳India mrinalini9 New Delhi

    Updated patch #1 by addressing #2, please review it.

    Thanks!

  • Status changed to RTBC about 1 year ago
  • 🇧🇷Brazil elber Brazil

    Hi I reviewed the last patch
    The module keeps working normally
    PHPCS errors has been fixed
    Moving to RTBC

  • Status changed to Fixed about 1 year ago
  • 🇯🇴Jordan abu-zakham

    Thanks, I have change the validate function name to lpl_validate instead of lpl_logo_per_language_validate and removed unwanted language_entities variable.

  • Status changed to Fixed about 1 year ago
  • 🇧🇷Brazil elber Brazil

    Thank you!

Production build 0.71.5 2024