Coding Standard issues

Created on 6 September 2024, 3 months ago
Updated 12 September 2024, 3 months ago

Problem/Motivation

Drupal Coding standards should be fixed.

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

FILE: .../web/modules/custom/date_filter/src/Plugin/views/filter/DateBase.php
------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------
24 | ERROR | Missing @var tag in member variable comment
29 | ERROR | Missing @var tag in member variable comment
34 | ERROR | Missing @var tag in member variable comment
------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/date_filter/Readme.md
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 88 characters
4 | WARNING | Line exceeds 80 characters; contains 94 characters
---------------------------------------------------------------------------

FILE: .../web/modules/custom/date_filter/tests/src/Functional/DateFilterTest.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
43 | ERROR | Missing @var tag in member variable comment
---------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/date_filter/tests/src/Kernel/DateFilterTest.php
-----------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------
74 | ERROR | Missing @var tag in member variable comment
79 | ERROR | Missing @var tag in member variable comment
-----------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/date_filter/tests/date_filter_test/date_filter_test.info.yml
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal --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

Fixed

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 !15Coding standard issues - #3472618 ā†’ (Merged) created by alyaj2a
  • Status changed to Needs review 3 months ago
  • Issue was unassigned.
  • Status changed to Needs work 3 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @alyaj2a,

    Thank you for providing an MR. I applied MR!15, it was applied smoothly and fixed most of the phpcs issues.

    These is the remaining issue after I ran phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig:

    āžœ  date_filter git:(1.0.x) curl https://git.drupalcode.org/project/date_filter/-/merge_requests/15.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3070    0  3070    0     0   6454      0 --:--:-- --:--:-- --:--:--  6449
    patching file Readme.md
    patching file src/Plugin/views/filter/DateBase.php
    patching file tests/date_filter_test/date_filter_test.info.yml
    patching file tests/src/Functional/DateFilterTest.php
    patching file tests/src/Kernel/DateFilterTest.php
    āžœ  date_filter git:(1.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml date_filter
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/date_filter/date_filter.module
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------
     11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\date_filter\Plugin\views\filter\DateTime.
    ------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 268ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

  • Assigned to akshaydalvi212
  • šŸ‡®šŸ‡³India akshaydalvi212

    I will remove the remaining issue.

  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • šŸ‡®šŸ‡³India akshaydalvi212

    hi @cleavinjosh,
    Resolved the last issue, you can review the MR now.
    Thanks and regards.

  • Status changed to RTBC 3 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @akshaydalvi212,

    Thank you for providing updating the MR. I applied MR!15, it was applied smoothly and fixed all the phpcs issues.

    āžœ  date_filter git:(1.0.x) curl https://git.drupalcode.org/project/date_filter/-/merge_requests/15.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3622    0  3622    0     0   7786      0 --:--:-- --:--:-- --:--:--  7806
    patching file Readme.md
    patching file date_filter.module
    patching file src/Plugin/views/filter/DateBase.php
    patching file tests/date_filter_test/date_filter_test.info.yml
    patching file tests/src/Functional/DateFilterTest.php
    patching file tests/src/Kernel/DateFilterTest.php
    āžœ  date_filter git:(1.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml date_filter
    āžœ  contrib git:(main) āœ—

    Thank you.

  • First commit to issue fork.
  • Status changed to Fixed 3 months ago
  • šŸ‡µšŸ‡±Poland Graber

    TY all!

  • šŸ‡µšŸ‡ŖPeru alyaj2a

    Thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024