Fix eslint/phpcs/phpstan issues

Created on 19 February 2024, 10 months ago

Problem/Motivation

The new Gitlab CI pipeline reports a bunch of eslint/phpcs/phpstan issues. We should fix these to make the pipeline completely green.

Steps to reproduce

Fix all code style related issues.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @dieterholvoet
  • Assigned to thakurnishant_06
  • Merge request !49fixed eslint errors /warnings → (Open) created by thakurnishant_06
  • Pipeline finished with Failed
    10 months ago
    Total: 447s
    #101177
  • Pipeline finished with Failed
    10 months ago
    Total: 357s
    #103786
  • Pipeline finished with Failed
    10 months ago
    #103814
  • Pipeline finished with Failed
    10 months ago
    Total: 364s
    #103837
  • Issue was unassigned.
  • 🇮🇳India d-xpert Chandigarh
  • Pipeline finished with Failed
    10 months ago
    Total: 381s
    #103860
  • First commit to issue fork.
  • Pipeline finished with Failed
    10 months ago
    Total: 327s
    #104954
  • 🇮🇳India adwivedi008

    Fixed a few remaining issues but some issues remain
    The remaining issues are:

    FILE: /eck.module
    -------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -------------------------------------------------------------------------------------
     27 | WARNING | Global constants should not be used, move it to a class or interface
     32 | WARNING | Global constants should not be used, move it to a class or interface
    -------------------------------------------------------------------------------------
    
    FILE: src/Form/EntityType/EckEntityTypeFormBase.php
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ----------------------------------------------------------------------------------------------
      93 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     157 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------
    
    FILE: /src/Form/EntityBundle/EckEntityBundleForm.php
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------------------------------
     110 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     215 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     218 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     281 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------
    
    FILE: /README.md
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------
     3 | WARNING | Line exceeds 80 characters; contains 84 characters
     4 | WARNING | Line exceeds 80 characters; contains 85 characters
     7 | WARNING | Line exceeds 80 characters; contains 85 characters
     8 | WARNING | Line exceeds 80 characters; contains 85 characters
    ----------------------------------------------------------------------
    
    FILE: /tests/src/Kernel/EckEntityTest.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     42 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
    -------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /tests/src/Unit/UnitTestBase.php
    ----------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ----------------------------------------------------------------------------
     51 | WARNING | Unused variable $methods.
     81 | WARNING | Unused private method getEntityManagerMock()
    ----------------------------------------------------------------------------
    

    I have used the following command for checking the Drupal-PHP-CBF/CS issues

    vendor/binphpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml ./
    

    Please review

  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
  • 🇮🇳India akshaydalvi212

    Resolved all the issues only the below issues remain.
    you can review the updated MR.

    FILE: /home/admin1/task/drupal9-os/web/modules/contrib/eck-3422393/tests/src/Unit/UnitTestBase.php
    --------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------
    51 | WARNING | Unused variable $methods.
    81 | WARNING | Unused private method getEntityManagerMock()
    --------------------------------------------------------------------------------------------------

    FILE: /home/admin1/task/drupal9-os/web/modules/contrib/eck-3422393/eck.module
    -------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -------------------------------------------------------------------------------------
    27 | WARNING | Global constants should not be used, move it to a class or interface
    32 | WARNING | Global constants should not be used, move it to a class or interface
    -------------------------------------------------------------------------------------

  • Pipeline finished with Failed
    9 months ago
    Total: 671s
    #134761
  • Status changed to Needs work 9 months ago
  • 🇧🇪Belgium dieterholvoet Brussels

    This issue is not just about phpcs issue. As long as eslint/phpcs/phpstan issues are present and the pipeline isn't green, this isn't ready.

  • First commit to issue fork.
  • Pipeline finished with Failed
    9 months ago
    Total: 313s
    #138777
  • Assigned to koustav_mondal
  • 🇮🇳India koustav_mondal Kolkata

    Working on it

  • Pipeline finished with Failed
    7 days ago
    Total: 154s
    #366288
  • 🇮🇳India koustav_mondal Kolkata

    Fixed phpcs and phpstan error.

  • Pipeline finished with Failed
    2 days ago
    Total: 482s
    #370958
  • Pipeline finished with Failed
    2 days ago
    Total: 139s
    #371000
  • Pipeline finished with Failed
    1 day ago
    Total: 138s
    #371018
  • Pipeline finished with Failed
    1 day ago
    Total: 136s
    #371027
  • 🇮🇳India koustav_mondal Kolkata

    All eslint/phpcs/phpstan issues are fixed now. Pipeline is green for eslint/phpcs/phpstan.

Production build 0.71.5 2024