Problem/Motivation

FILE: /var/www/html/vb/d_cont/seb/README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
------------------------------------------------------------------------
3 | WARNING | [ ] Line exceeds 80 characters; contains 151 characters
5 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
7 | WARNING | [ ] Line exceeds 80 characters; contains 96 characters
12 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
14 | WARNING | [ ] Line exceeds 80 characters; contains 133 characters
18 | WARNING | [ ] Line exceeds 80 characters; contains 142 characters
22 | WARNING | [ ] Line exceeds 80 characters; contains 120 characters
28 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/seb/src/Plugin/Derivative/EntityBlock.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
83 | WARNING | [x] 'TODO: Add proper config dependencies.' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/seb/seb.info.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
----------------------------------------------------------------------

Time: 148ms; Memory: 12MB

Steps to reproduce

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

Remaining tasks

Patch review

Issue fork seb-3372227

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

urvashi_vora created an issue. See original summary.

satish_kumar’s picture

StatusFileSize
new3.96 KB

Hii, @urvashi_vora

These are the steps I followed:

1. Took clone from git version 1.0.x in drupal 10.1.x

2. Ran this command:

./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig modules/contrib/seb/

3. Applied your patch and, again ran phpcs command

found errors.

4. Fixed the errors and provide the patch.

Please Review.

clarkssquared’s picture

Status: Needs review » Needs work

Hi Satish_kumar,

I tried to apply your patch using git apply -v but the patch skips and fails to apply, please look at the result in my terminal below:

 seb git:(master) ✗ curl https://www.drupal.org/files/issues/2023-09-21/coding-standard-fixed-3372227-2.patch | git apply -v
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4056  100  4056    0     0  15392      0 --:--:-- --:--:-- --:--:-- 15905
Skipped patch 'README.md'.
Skipped patch 'seb.info.yml'.
Skipped patch 'src/Plugin/Block/EntityBlock.php'.
Skipped patch 'src/Plugin/Derivative/EntityBlock.php'.

I then used the patch -p1 approach and the patch was applied except for seb.info.yml because it's been rejected

➜  seb git:(master) ✗ curl https://www.drupal.org/files/issues/2023-09-21/coding-standard-fixed-3372227-2.patch | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4056  100  4056    0     0  11585      0 --:--:-- --:--:-- --:--:-- 11825
patching file README.md
patching file seb.info.yml
1 out of 1 hunks failed--saving rejects to seb.info.yml.rej
patching file 'src/Plugin/Block/EntityBlock.php'
patching file 'src/Plugin/Derivative/EntityBlock.php'

I then tried to execute the PHPCS command but there are still many PHPCS issues being flagged, for your reference, below are the issues being flagged:

➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml seb

FILE: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/seb/README.md
--------------------------------------------------------------------------------------
FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------------
  3 | WARNING | [ ] Line exceeds 80 characters; contains 151 characters
  5 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
  7 | WARNING | [ ] Line exceeds 80 characters; contains 96 characters
 12 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
 14 | WARNING | [ ] Line exceeds 80 characters; contains 133 characters
 18 | WARNING | [ ] Line exceeds 80 characters; contains 142 characters
 22 | WARNING | [ ] Line exceeds 80 characters; contains 120 characters
 28 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/seb/seb.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: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/seb/src/Plugin/Derivative/EntityBlock.php
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
 83 | WARNING | [x] 'TODO: Add proper config dependencies.' should match the format '@todo Fix problem X here.'
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------


FILE: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/seb/src/Plugin/Block/EntityBlock.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
 12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

Time: 324ms; Memory: 14MB

➜  contrib git:(master) ✗ 
sakthi_dev’s picture

StatusFileSize
new79.31 KB

Hi @clarkssquared, I tried to apply the #2 patch and it applied successfully and no issues lists for phpcs. After one more review we can move to RTBC, Attaching the screenshot.

aayushmankotia’s picture

Status: Needs work » Needs review
aayushmankotia’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new90.13 KB

Hi,
The #2 patch was successfully applied with no remaining issues listed for phpcs. Please refer to the attached screenshot for your reference and verification.
alt

Moving to RTBC .
Thanks.

syammohanmp made their first commit to this issue’s fork.

  • 9d2e4bf2 committed on 1.0.x
    #3372227: Drupal standard fixes.
    
syammohanmp’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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