Fix the issues reported by PHP_CodeSniffer

Created on 26 September 2024, about 2 months ago

Problem/Motivation

FILE: file_crusader\file_crusader.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

FILE: file_crusader\file_crusader.install
-----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------

FILE: file_crusader\file_crusader.module
--------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 32 ERRORS AND 2 WARNINGS AFFECTING 19 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\File\FileSystemInterface.
10 | ERROR | [x] Missing function doc comment
23 | ERROR | [x] Case breaking statements must be followed by a single blank line
31 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
33 | ERROR | [ ] Parameter comment must start with a capital letter
33 | ERROR | [x] Parameter comment must be on the next line
33 | ERROR | [x] Parameter comment must end with a full stop
34 | ERROR | [ ] Parameter comment must start with a capital letter
34 | ERROR | [x] Parameter comment must be on the next line
34 | ERROR | [x] Parameter comment must end with a full stop
38 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
49 | ERROR | [x] Expected 1 blank line after function; 2 found
62 | ERROR | [x] Inline comments must start with a capital letter
62 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
64 | ERROR | [x] Inline comments must start with a capital letter
64 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
67 | ERROR | [x] Inline comments must start with a capital letter
67 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
67 | ERROR | [x] Comments may not appear after statements
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
68 | ERROR | [x] Comments may not appear after statements
69 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
69 | ERROR | [x] Inline comments must start with a capital letter
69 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
69 | ERROR | [x] Comments may not appear after statements
78 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
87 | ERROR | [x] Missing function doc comment
89 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
89 | ERROR | [x] Expected one space after the comma, 2 found
126 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
126 | ERROR | [x] No space found before comment text; expected "// $new_location = str_replace(parse_url($old_location, PHP_URL_SCHEME),
| | $scheme, $old_location);" but found "//$new_location = str_replace(parse_url($old_location, PHP_URL_SCHEME), $scheme,
| | $old_location);"
129 | ERROR | [x] Expected newline after closing brace
--------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 29 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------

FILE: file_crusader\README.md
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
29 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

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

Merge Requests

Comments & Activities

  • Issue created by @sunil jolapara
  • šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @sunil jolapara,

    Thank you for providing an MR. I applied MR!2, it was applied smoothly and fixed most of the phpcs issues.

    These are the remaining issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml:

    āžœ  file_crusader git:(1.0.0-alpha2) curl https://git.drupalcode.org/project/file_crusader/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  6585    0  6585    0     0  11649      0 --:--:-- --:--:-- --:--:-- 11634
    patching file README.md
    patching file file_crusader.install
    patching file file_crusader.module
    āžœ  file_crusader git:(1.0.0-alpha2) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml file_crusader
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/file_crusader/file_crusader.module
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------
     183 | WARNING | Unused variable $copy_results.
    ------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 127ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024