Fix the issues reported by phpcs

Created on 15 March 2023, almost 2 years ago
Updated 18 September 2024, 3 months ago

Problem/Motivation

FILE: /Users/projects/drupal-d10/modules/contrib/views_filters_summary/css/views_filters_summary.css
----------------------------------------------------------------------
FOUND 31 ERRORS AFFECTING 15 LINES
----------------------------------------------------------------------
  2 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  3 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  4 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  4 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  5 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  6 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  7 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  8 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  9 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  9 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 10 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 10 | ERROR | [x] CSS colours must be defined in lowercase; expected #8c1515 but found #8C1515
 14 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 19 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 20 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 21 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 22 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 23 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
----------------------------------------------------------------------
PHPCBF CAN FIX THE 31 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /Users/projects/drupal-d10/modules/contrib/views_filters_summary/views_filters_summary.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /Users/projects/drupal-d10/modules/contrib/views_filters_summary/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 19 | WARNING | Line exceeds 80 characters; contains 153 characters
----------------------------------------------------------------------


FILE: /Users/projects/drupal-d10/modules/contrib/views_filters_summary/src/Plugin/views/area/ViewsFiltersSummary.php
----------------------------------------------------------------------
FOUND 8 ERRORS AND 12 WARNINGS AFFECTING 20 LINES
----------------------------------------------------------------------
 114 | WARNING | [x] A comma should follow the last multiline array item. Found: 'result'
 115 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 190 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 191 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 192 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 262 | ERROR   | [x] Expected newline after closing brace
 302 | ERROR   | [x] Expected newline after closing brace
 305 | ERROR   | [x] Line indented incorrectly; expected 14 spaces, found 16
 312 | ERROR   | [x] Expected newline after closing brace
 355 | WARNING | [x] A comma should follow the last multiline array item. Found: "clear {$value}"
 356 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 459 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 463 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 467 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 468 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 506 | ERROR   | [x] Expected 1 space before opening brace; found 2
 537 | WARNING | [x] A comma should follow the last multiline array item. Found: value
 556 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 573 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 617 | ERROR   | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 146ms; Memory: 14MB

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India rassoni Bangalore

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 @rassoni
  • @rashmisoni opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • šŸ‡®šŸ‡³India rassoni Bangalore

    Please review MR.

  • šŸ‡®šŸ‡³India rajneeshb New Delhi

    Reviewed MR!16 looks good, all reported issue fixed, +1 RTBC

    Attaching SS for reference.

  • Status changed to Needs work 4 months ago
  • Hi @Rassoni,

    Applied the latest changes you committed on MR!16, it was applied not-so successfully and one file with 7 errors were reported. Please see below:

    āžœ  views_filters_summary git:(2.0.x) curl https://git.drupalcode.org/project/views_filters_summary/-/merge_requests/16.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  6973    0  6973    0     0  20567      0 --:--:-- --:--:-- --:--:-- 21655
    patching file README.txt
    patching file css/views_filters_summary.css
    patching file src/Plugin/views/area/ViewsFiltersSummary.php
    Hunk #6 succeeded at 460 (offset 1 line).
    Hunk #7 succeeded at 507 (offset 1 line).
    Hunk #8 succeeded at 538 (offset 1 line).
    Hunk #9 succeeded at 559 (offset 2 lines).
    Hunk #10 succeeded at 577 (offset 2 lines).
    Hunk #11 succeeded at 621 (offset 2 lines).
    patching file views_filters_summary.module
    āžœ  views_filters_summary git:(2.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig views_filters_summary
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/views_filters_summary/src/Plugin/views/area/ViewsFiltersSummary.php
    --------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 7 ERRORS AFFECTING 7 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------
       9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Render\MarkupInterface.
      70 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
      85 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
     129 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
     344 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
     380 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
     609 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    --------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 273ms; Memory: 14MB

    Kindly check

    Thanks,
    Jake

  • Status changed to Fixed 4 months ago
  • šŸ‡«šŸ‡·France mably

    Fixed in 3.0.x-dev branch.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024