Coding Standard Issues

Created on 17 September 2024, 2 months ago
Updated 18 September 2024, 2 months ago

Problem/Motivation

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

FILE: .../web/modules/custom/critical_css/src/Asset/CssCollectionRenderer.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Html.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/critical_css/src/Asset/CriticalCssProvider.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Path\CurrentPathStack.
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/critical_css/tests/src/Functional/CriticalCssHeadTest.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\node\Entity\NodeType.
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

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
  • Assigned to alyaj2a
  • Merge request !10Coding Standard issues - #3475000 ā†’ (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

    I checked the module and applied the MR !10 and I can still see PHPCS issues

    āžœ  critical_css git:(2.0.x) curl https://git.drupalcode.org/project/critical_css/-/merge_requests/10.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2082    0  2082    0     0   3953      0 --:--:-- --:--:-- --:--:--  4011
    patching file 'src/Asset/CriticalCssProvider.php'
    patching file 'src/Asset/CssCollectionRenderer.php'
    patching file 'tests/src/Functional/CriticalCssHeadTest.php'
    āžœ  critical_css git:(2.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml critical_css 
    
    FILE: /Users/clarksubing-subing/Projects/d10/drupal_local/web/modules/contrib/critical_css/src/Form/SettingsForm.php
    --------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------
     34 | 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/critical_css/src/Asset/CriticalCssProvider.php
    ----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------
     152 | 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: 404ms; Memory: 12MB
    
    āžœ  contrib git:(main) āœ— 
    
  • šŸ‡ŖšŸ‡øSpain albertosilva Basque Country

    Thanks, fixed and merged

  • šŸ‡ŖšŸ‡øSpain albertosilva Basque Country
Production build 0.71.5 2024