Coding standard issues

Created on 10 September 2024, 2 months ago
Updated 12 September 2024, 2 months ago

Problem/Motivation

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

FILE: .../web/modules/custom/yearonly/src/Feeds/Target/YearOnly.php
--------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
23 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
24 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
25 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
26 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 7
27 | ERROR | [x] Closing brace indented incorrectly; expected 3 spaces, found 4
29 | ERROR | [x] Expected 1 blank line after function; 0 found
30 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/yearonly/src/Plugin/Field/FieldWidget/YearOnlyDefaultWidget.php
---------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
75 | ERROR | [x] Expected 1 space after IF keyword; 0 found
75 | ERROR | [x] Expected 1 space after closing parenthesis; found 5
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Needs review

Version

9.0

Component

Code

Created by

šŸ‡µšŸ‡ŖPeru alyaj2a

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

Merge Requests

Comments & Activities

  • Issue created by @alyaj2a
  • Assigned to alyaj2a
  • Merge request !13Resolve #3473443 "Coding standard issues" ā†’ (Open) created by alyaj2a
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • Status changed to Needs work 2 months ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi alyaj2a,

    I reviewed MR!3, applied against Year Only 9.x-dev and there are still error show below:

    āžœ  contrib āœ— cd yearonly
    āžœ  yearonly git:(9.x) curl https://git.drupalcode.org/project/yearonly/-/merge_requests/13.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2441    0  2441    0     0   5693      0 --:--:-- --:--:-- --:--:--  5784
    patching file 'src/Feeds/Target/YearOnly.php'
    patching file 'src/Plugin/Field/FieldWidget/YearOnlyDefaultWidget.php'
    āžœ  yearonly git:(9.x) āœ— cd ..
    āžœ  contrib āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig yearonly
    
    FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/yearonly/src/Plugin/Field/FieldWidget/YearOnlyDefaultWidget.php
    -------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\WidgetBase.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/yearonly/src/Plugin/Field/FieldType/YearOnlyItem.php
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldStorageDefinitionInterface.
    -------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------
    

    Please check and advise, the issue exists on 9.x-dev.
    Thank you.

  • šŸ‡µšŸ‡ŖPeru alyaj2a

    Thanks paraderojether! I am going to check it.

  • šŸ‡µšŸ‡ŖPeru alyaj2a

    Hello paraderojether! I already uploaded the changes! Thanks!

  • Status changed to Needs review 2 months ago
Production build 0.71.5 2024