Line exceeds 80 characters

Created on 6 June 2023, about 1 year ago
Updated 9 June 2023, about 1 year ago

Problem/Motivation

Fix all Line exceeds 80 characters; contains 81 characters

Steps to reproduce

Run the command:

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

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: D:\xampp\htdocs\my_site_name_dir\web\modules\contrib\sidekick\README.md
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
53 | WARNING | Line exceeds 80 characters; contains 90 characters
-----------------------------------------------------------------------------

FILE: D:\xampp\htdocs\my_site_name_dir\web\modules\contrib\sidekick\sidekick.module
--------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 7 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
34 | ERROR | [x] Expected 1 space after IF keyword; 0 found
34 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
40 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Acolono'
55 | ERROR | [x] Expected newline after closing brace
60 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
70 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
73 | ERROR | [x] Expected newline after closing brace
77 | WARNING | [x] A comma should follow the last multiline array item. Found: message
80 | ERROR | [x] Expected newline after closing brace
84 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
84 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
84 | WARNING | [x] A comma should follow the last multiline array item. Found: )
94 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\my_site_name_dir\web\modules\contrib\sidekick\src\Controller\SidekickController.php
---------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
41 | ERROR | [ ] Missing short description in doc comment
42 | ERROR | [ ] Missing parameter comment
43 | ERROR | [ ] Missing parameter comment
44 | ERROR | [ ] Missing parameter comment
72 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Acolono'
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\my_site_name_dir\web\modules\contrib\sidekick\src\Form\SettingsForm.php
---------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
40 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
46 | WARNING | [x] A comma should follow the last multiline array item. Found: )
49 | WARNING | [x] A comma should follow the last multiline array item. Found: )
64 | ERROR | [x] Expected 1 space after IF keyword; 0 found
64 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\my_site_name_dir\web\modules\contrib\sidekick\src\SidekickService.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 23 ERRORS AND 2 WARNINGS AFFECTING 16 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
20 | ERROR | [ ] Class property $http_client should use lowerCamel naming without underscores
22 | ERROR | [ ] Missing short description in doc comment
23 | ERROR | [x] Expected "key_status_api" but found "$key_status_api" for @var tag in member variable comment
25 | ERROR | [ ] Class property $key_status_api should use lowerCamel naming without underscores
34 | ERROR | [x] Expected 1 blank line before function; 2 found
39 | ERROR | [ ] Missing short description in doc comment
40 | ERROR | [ ] Missing parameter comment
40 | ERROR | [ ] Missing parameter type
41 | ERROR | [ ] Missing parameter comment
41 | ERROR | [ ] Missing parameter type
42 | ERROR | [ ] Description for the @return value is missing
52 | WARNING | [x] A comma should follow the last multiline array item. Found: $language_code
53 | WARNING | [x] A comma should follow the last multiline array item. Found: )
57 | ERROR | [ ] The array declaration extends to column 101 (the limit is 80). The array content should be split up over multiple lines
59 | ERROR | [x] Expected newline after closing brace
59 | ERROR | [x] Expected 1 space before "|"; 0 found
59 | ERROR | [x] Expected 1 space after "|"; 0 found
59 | ERROR | [x] Expected 1 space before "|"; 0 found
59 | ERROR | [x] Expected 1 space after "|"; 0 found
59 | ERROR | [x] Expected 1 space before "|"; 0 found
59 | ERROR | [x] Expected 1 space after "|"; 0 found
62 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
65 | ERROR | [x] Expected 1 newline at end of file; 0 found
65 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

📌 Task
Status

Postponed

Version

1.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
  • Assigned to shyam-sawhney
  • 🇦🇹Austria Grienauer Vienna
  • Assigned to arti_parmar
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India arti_parmar

    Kindly review patch.

  • Status changed to Needs work about 1 year ago
  • 🇵🇭Philippines clarkssquared

    Hi arti_parmar

    I applied your patch #3 to my local and here's my feedback:

    1. The patch applies but the whitespace error has been flagged.

    Applied patch src/Controller/SidekickController.php cleanly.
    Applied patch src/Form/SettingsForm.php cleanly.
    Applied patch src/SidekickService.php cleanly.
    warning: 1 line adds whitespace errors.

    2. When I run phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml sidekick/ there are still warning being flagged.

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/sidekick/sidekick.module
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------
    92 | WARNING | Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
    92 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
    ----------------------------------------------------------------------------------------------------------------------

    3. I also added DrupalPractice standard in phpcs command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml sidekick and below are the warnings being flagged.

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/sidekick/sidekick.module
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------
    92 | WARNING | Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
    92 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
    ----------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/sidekick/src/SidekickService.php
    --------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------
    56 | WARNING | Unused variable $apiResponse.
    --------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Projects/drupalorgissues/docroot/modules/contrib/sidekick/src/Form/SettingsForm.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ----------------------------------------------------------------------------------------------------------------
    59 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    61 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    72 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------------------------

    Time: 281ms; Memory: 10MB

    Please fix the warnings if possible.

    Thank you.

  • Status changed to Postponed about 1 year ago
Production build 0.69.0 2024