Problem/Motivation

It would be great to address the below minor PHPCS issues :

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

FILE: /var/www/web/themes/contrib/radix/includes/form.theme
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you
    |         | mean hook_form_FORM_ID_alter()?
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/radix.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.starterkit.yml
-------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 11 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.libraries.yml
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
 61 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/media/media.component.yml
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
 35 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/field-comment/field-comment.component.yml
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 24 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/offcanvas/offcanvas.component.yml
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
 109 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/local-tasks/local-tasks.component.yml
----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------
 14 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/comment/comment.component.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 47 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/fieldset/fieldset.component.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 62 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/progress/progress.component.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 75 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/form-element--radiocheckbox/form-element--radiocheckbox.component.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 35 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/form-element--label/form-element--label.component.yml
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 19 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/taxonomy/taxonomy.component.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 74 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/list-group/list-group.component.yml
--------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------
 81 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/dropdown-menu/dropdown-menu.component.yml
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 92 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

Time: 453ms; Memory: 12MB

Steps to reproduce

Run the command,
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml radix/

Proposed resolution

Fix the PHPCS issues.

Issue fork radix-3500879

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

abhiyanshu created an issue. See original summary.

abhiyanshu’s picture

Issue summary: View changes
abhiyanshu’s picture

Status: Active » Needs review

Fixed all the PHPCS issues except for one warning.
I'll leave this for your decision, or please let me know how you'd like to proceed. Thanks you.

FILE: /var/www/web/themes/contrib/radix/includes/form.theme
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you
    |         | mean hook_form_FORM_ID_alter()?
clarkssquared’s picture

Hi abhiyanshu,

I applied the MR !126 and I can see PHPCS errors aside from the one you mentioned.

➜  radix git:(main) ✗ curl https://git.drupalcode.org/project/radix/-/merge_requests/126.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8653    0  8653    0     0  13631      0 --:--:-- --:--:-- --:--:-- 13822
patching file 'components/comment/comment.component.yml'
patching file 'components/dropdown-menu/dropdown-menu.component.yml'
patching file 'components/field-comment/field-comment.component.yml'
patching file 'components/fieldset/fieldset.component.yml'
patching file 'components/form-element--label/form-element--label.component.yml'
patching file 'components/form-element--radiocheckbox/form-element--radiocheckbox.component.yml'
patching file 'components/list-group/list-group.component.yml'
patching file 'components/local-tasks/local-tasks.component.yml'
patching file 'components/media/media.component.yml'
patching file 'components/offcanvas/offcanvas.component.yml'
patching file 'components/progress/progress.component.yml'
patching file 'components/taxonomy/taxonomy.component.yml'
patching file radix.info.yml
1 out of 1 hunks failed--saving rejects to radix.info.yml.rej
patching file 'src/kits/radix_starterkit/radix_starterkit.info.yml'
1 out of 1 hunks failed--saving rejects to 'src/kits/radix_starterkit/radix_starterkit.info.yml.rej'
patching file 'src/kits/radix_starterkit/radix_starterkit.libraries.yml'
patching file 'src/kits/radix_starterkit/radix_starterkit.starterkit.yml'
➜  radix git:(main) ✗ ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml radix 

FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/radix.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------


FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/includes/block.theme
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\block_content\BlockContentInterface.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/includes/form.theme
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you mean hook_form_FORM_ID_alter()?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.info.yml
--------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
--------------------------------------------------------------------------------------------------------------------------------------------------

Time: 497ms; Memory: 10MB

➜  contrib git:(main) ✗ 
danchadwick’s picture

Status: Needs review » Needs work
schillerm’s picture

Hi all, I also ran phpcs on !MR126 this and got the same as #4.

FILE: /home/laptopuser/Documents/Issues/Dev-11-3500879/web/themes/contrib/radix/includes/form.theme
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you mean hook_form_FORM_ID_alter()?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I added $form_id to the signature/parameters but it was still throwing an error. Annoying. Feels like this is a phpcs glitch or something. I updated my version of phpcs and rerun - same error.

doxigo’s picture

Anyone can clean this up against the latest dev version instead of 6.0.1 and fix the merge request conflicts? thanks

liam morland made their first commit to this issue’s fork.

liam morland’s picture

Version: 6.0.1 » 6.0.x-dev
Status: Needs work » Needs review
paraderojether’s picture

Status: Needs review » Needs work

Hi

I reviewed MR!26, and confirmed it passed on Gitlab CI.

However when I run the phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig radix there are still PHPCS warning shown below:

Jether@PrometSources-MacBook-Pro-4 contrib % cd radix
Jether@PrometSources-MacBook-Pro-4 radix % curl https://git.drupalcode.org/project/radix/-/merge_requests/126.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 35947    0 35947    0     0  62277      0 --:--:-- --:--:-- --:--:-- 62299
patching file .gitlab-ci.yml
patching file 'Commands/radix/SubThemeCommands.php'
patching file 'components/accordion/accordion.scss'
patching file 'components/badge/badge.scss'
patching file 'components/block/block.scss'
patching file 'components/breadcrumb/breadcrumb.scss'
patching file 'components/button-group/button-group.scss'
patching file 'components/button/button.scss'
patching file 'components/card/card.scss'
patching file 'components/carousel/carousel.scss'
patching file 'components/close-button/close-button.scss'
patching file 'components/comment/comment.scss'
patching file 'components/details/details.scss'
patching file 'components/dropdown-menu/dropdown-menu.component.yml'
patching file 'components/dropdown-menu/dropdown-menu.scss'
patching file 'components/dropdown/dropdown.scss'
patching file 'components/field-comment/field-comment.scss'
patching file 'components/field/field.scss'
patching file 'components/fieldset/fieldset.component.yml'
patching file 'components/figure/figure.scss'
patching file 'components/form-element--label/form-element--label.component.yml'
patching file 'components/form-element--radiocheckbox/form-element--radiocheckbox.component.yml'
patching file 'components/form-element--radiocheckbox/form-element--radiocheckbox.scss'
patching file 'components/form/form.scss'
patching file 'components/heading/heading.scss'
patching file 'components/html/html.scss'
patching file 'components/image/image.scss'
patching file 'components/input/input.scss'
patching file 'components/list-group/list-group.component.yml'
patching file 'components/list-group/list-group.scss'
patching file 'components/local-tasks/local-tasks.component.yml'
patching file 'components/local-tasks/local-tasks.scss'
patching file 'components/media/media.component.yml'
patching file 'components/media/media.scss'
patching file 'components/modal/modal.scss'
patching file 'components/nav-item/nav-item.scss'
patching file 'components/nav/nav.scss'
patching file 'components/navbar-brand/navbar-brand.scss'
patching file 'components/navbar/navbar.scss'
patching file 'components/node/node.scss'
patching file 'components/offcanvas/offcanvas.component.yml'
patching file 'components/offcanvas/offcanvas.scss'
patching file 'components/page-content/page-content.scss'
patching file 'components/page-footer/page-footer.scss'
patching file 'components/page-navigation/page-navigation.scss'
patching file 'components/page-title/page-title.scss'
patching file 'components/page/page.scss'
patching file 'components/pagination/pagination.scss'
patching file 'components/progress/progress.component.yml'
patching file 'components/progress/progress.scss'
patching file 'components/radios/radios.scss'
patching file 'components/region/region.scss'
patching file 'components/select/select.scss'
patching file 'components/spinner/spinner.scss'
patching file 'components/table/table.scss'
patching file 'components/taxonomy/taxonomy.scss'
patching file 'components/textarea/textarea.scss'
patching file 'components/toasts/toasts.scss'
patching file 'components/user/user.scss'
patching file 'components/views-view--grid/views-view--grid.scss'
patching file 'components/views-view--table/views-view--table.scss'
patching file 'components/views-view--unformatted/views-view--unformatted.scss'
patching file radix.info.yml
patching file radix.libraries.yml
patching file 'src/kits/radix_starterkit/radix_starterkit.info.yml'
patching file 'src/kits/radix_starterkit/radix_starterkit.starterkit.yml'
patching file 'src/kits/radix_starterkit/src/scss/base/_variables.scss'
patching file 'src/kits/radix_starterkit/templates/form/form-element--checkbox.html.twig'
patching file 'src/kits/radix_starterkit/templates/form/form-element-label.html.twig'
Jether@PrometSources-MacBook-Pro-4 radix % cd ..
Jether@PrometSources-MacBook-Pro-4 contrib % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig radix

FILE: /Users/Jether/Q1/q1issues/web/themes/contrib/radix/includes/form.theme
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you mean hook_form_FORM_ID_alter()?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 256ms; Memory: 12MB

Kindly check and advise, please.
Thank you.

liam morland’s picture

Status: Needs work » Needs review

I think this issue should be about getting phpcs checks in Gitlab CI to pass. Other changes can happen in a follow-up.

The issue in #11 is a false-positive. It is confused because the filename is form.theme. But this code is in radix, so the function name and its documentation are correct.

roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community

Hi,

I reviewed the PHPCS results in the GitLab CI pipeline and confirmed that the errors no longer exist.
Here is the link for reference:
PHPCS: https://git.drupalcode.org/issue/radix-3500879/-/jobs/8388837

I'm moving this now to "RTBC".

Thank you!

doxigo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone, merged.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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