Fix the issues reported by phpcs

Created on 5 July 2023, over 1 year ago
Updated 16 April 2024, 7 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/simple_address/simple_address.services.yml
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/simple_address/README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------
2 | WARNING | [ ] Line exceeds 80 characters; contains 280 characters
3 | WARNING | [ ] Line exceeds 80 characters; contains 172 characters
13 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
14 | ERROR | [x] Expected 1 newline at end of file; 3 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/simple_address/config/schema/address.schema.yml
-----------------------------------------------------------------------------
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
-----------------------------------------------------------------------------

Time: 140ms; Memory: 10MB

Steps to reproduce

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

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

Merge Requests

Comments & Activities

  • Issue created by @urvashi_vora
  • Status changed to Needs work 10 months ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    Provided patch does not get applied and throwing error.

  • First commit to issue fork.
  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India viren18febS

    Hi i have fixed the issues and added a patch , please review.
    Thanks

  • Status changed to Needs work 10 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied patch #4 and I noticed that there were still many PHPCS issues that needs to be fixed.

    āžœ  simple_address git:(master) āœ— curl https://www.drupal.org/files/issues/2024-01-18/issues-3372536-fixed-issue-reported-by-phpcs.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4016  100  4016    0     0   8463      0 --:--:-- --:--:-- --:--:--  8636
    patching file README.md
    patching file 'config/schema/address.schema.yml'
    No such line 31 in input file, ignoring
    1 out of 1 hunks failed--saving rejects to 'config/schema/address.schema.yml.rej'
    patching file simple_address.services.yml
    patching file 'src/Plugin/Field/FieldType/Address.php'
    patching file 'src/Plugin/Field/FieldType/AvailableCountriesTrait.php'
    patching file 'src/Plugin/Field/FieldWidget/AddressWidget.php'
    Reversed (or previously applied) patch detected!  Assume -R? [y] 
    āžœ  simple_address git:(master) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml simple_address 
    
    FILE: ...-local/web/modules/contrib/simple_address/config/schema/address.schema.yml
    --------------------------------------------------------------------------------
    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
    --------------------------------------------------------------------------------
    
    
    FILE: ...cts/d9/d9-local/web/modules/contrib/simple_address/simple_address.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: ...ules/contrib/simple_address/src/Plugin/Field/FieldWidget/AddressWidget.php
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     179 | ERROR | [x] Expected 1 blank line after function; 3 found
     182 | ERROR | [ ] More than 2 empty lines are not allowed
     183 | ERROR | [x] The closing brace for the class must have an empty line
         |       |     before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 349ms; Memory: 10MB
    
    āžœ  contrib git:(master) āœ— 
    
  • šŸ‡·šŸ‡ŗRussia zniki.ru

    Please use Merge Request instead of patch.
    You can read more information https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr... ā†’

  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India viren18febS

    I have tested this is i am not able to see any issues.

  • šŸ‡·šŸ‡ŗRussia zniki.ru

    As I see from the code provided by #5 patch was not applied.
    Probably because master branch was used, instead of 1.0.x.

    Also please don't use phpcs on yml files.
    Correct command should be:

    phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme 
    

    These file types used to run the check with phpcs. See https://git.drupalcode.org/project/gitlab_templates/-/blame/1.0.x/script...

    For check yml files please use eslint ā†’ .

    I believe issue topic name need to be changed, because there are no violations reported by phpcs in latest 1.0.x branch.

  • Status changed to Needs work 10 months ago
  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
  • šŸ‡®šŸ‡³India pray_12

    Hi,
    I have created the MR!.
    Please review.

  • Hi,
    I ran the command phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml simple_address/
    There are no errors found.

  • Merge request !4Addressed #6 comment ā†’ (Open) created by Unnamed author
  • šŸ‡ØšŸ‡¦Canada dstorozhuk Chicago šŸ‡ŗšŸ‡ø, Toronto šŸ‡ØšŸ‡¦, Kyiv šŸ‡ŗšŸ‡¦

    Guys, I see did some efforts fixing the code styles, thanks. The last update of this issue was 20 day ago.
    However, GITLab CI was introduced on 13 July 2023 https://www.drupal.org/association/blog/gitlab-ci-is-now-enabled-for-eve... ā†’ .
    So the right direction of this issue should be add the integration for the GITLab CI and then fix the remaining code styles issue.
    But, since we already did that in another issue - this issue does not make sense any more and could be closed.

  • Status changed to Fixed 8 months ago
  • šŸ‡ØšŸ‡¦Canada dstorozhuk Chicago šŸ‡ŗšŸ‡ø, Toronto šŸ‡ØšŸ‡¦, Kyiv šŸ‡ŗšŸ‡¦
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024