Coding Standard issues

Created on 12 September 2024, 2 months ago
Updated 13 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/swiper_formatter/templates/swiper-formatter-slide.html.twig
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
38 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/swiper_formatter/templates/swiper-formatter.html.twig
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
51 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/swiper_formatter/src/Plugin/Field/FieldFormatter/SwiperFormatterEntity.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
51 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/swiper_formatter/src/SwiperFormatterTrait.php
--------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
69 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2
77 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 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

1.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 !9Coding Standard Issues - #3474010 ā†’ (Closed) 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 applied MR !9 and there are still few PHPCS issues.

    āžœ  swiper_formatter git:(1.0.x) curl https://git.drupalcode.org/project/swiper_formatter/-/merge_requests/9.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2691    0  2691    0     0   5553      0 --:--:-- --:--:-- --:--:--  5641
    patching file 'src/Plugin/Field/FieldFormatter/SwiperFormatterEntity.php'
    patching file 'src/SwiperFormatterTrait.php'
    patching file 'templates/swiper-formatter-slide.html.twig'
    patching file 'templates/swiper-formatter.html.twig'
    āžœ  swiper_formatter git:(1.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml swiper_formatter 
    
    FILE: /Users/clarksubing-subing/Projects/d10/drupal_local/web/modules/contrib/swiper_formatter/src/Plugin/Field/FieldFormatter/SwiperFormatterEntity.php
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------------
     51 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/clarksubing-subing/Projects/d10/drupal_local/web/modules/contrib/swiper_formatter/src/SwiperFormatterTrait.php
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------
     77 | 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: 694ms; Memory: 14MB
    
    āžœ  contrib git:(main) āœ— 
    
  • šŸ‡³šŸ‡±Netherlands nk_
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024