Coding Standard Issues

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

Problem/Motivation

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

FILE: .../web/modules/custom/text_field_formatter/README.md
------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------
41 | WARNING | Line exceeds 80 characters; contains 916 characters
------------------------------------------------------------------------------------

FILE: .../web/modules/custom/text_field_formatter/src/Plugin/Field/FieldFormatter/TextFieldFormatter.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 13 LINES
------------------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
84 | ERROR | [x] The first parameter of a multi-line function declaration must be on the line after the opening bracket
85 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
86 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
87 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
88 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
89 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
90 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
91 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
92 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
93 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
94 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
94 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
375 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Needs work

Version

2.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
  • Merge request !5Coding standard issues - #3474000 ā†’ (Open) created by alyaj2a
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • Status changed to Needs work 2 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I checked your MR !5 and there's one remaining PHPCS issues being reported.

    āžœ  text_field_formatter git:(2.0.x) curl https://git.drupalcode.org/project/text_field_formatter/-/merge_requests/5.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4972    0  4972    0     0  10319      0 --:--:-- --:--:-- --:--:-- 10445
    patching file README.md
    patching file 'src/Plugin/Field/FieldFormatter/TextFieldFormatter.php'
    āžœ  text_field_formatter git:(2.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml text_field_formatter 
    
    FILE: ...ext_field_formatter/src/Plugin/Field/FieldFormatter/TextFieldFormatter.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     95 | ERROR | [x] Multi-line function declarations must have a trailing comma
        |       |     after the last parameter
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 156ms; Memory: 12MB
    
    āžœ  contrib git:(main) āœ— 
Production build 0.71.5 2024