Problem/Motivation

When I run the reported command, I get more errors/warnings.

This is command
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml --ignore=node_modules,bower_components,vendor web/modules/contrib/google_tag/

FILE: /web/modules/contrib/google_tag/tests/modules/google_tag_test/google_tag_test.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: /web/modules/contrib/google_tag/tests/src/Kernel/PageAttachmentsHookTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------
68 | ERROR | The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple
| | lines
118 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple
| | lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /web/modules/contrib/google_tag/google_tag.permissions.yml
------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------

FILE: /web/modules/contrib/google_tag/src/Plugin/GoogleTag/Event/Commerce/ViewItemList.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
25 | WARNING | Line exceeds 80 characters; contains 109 characters
--------------------------------------------------------------------------------------------------------------------------------

FILE: /web/modules/contrib/google_tag/google_tag.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: 20.36 secs; Memory: 14MB

CommentFileSizeAuthor
#14 ci.png60.42 KBjannakha

Issue fork google_tag-3573774

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

khasim_shaik created an issue. See original summary.

garvitasakhrani made their first commit to this issue’s fork.

garvitasakhrani’s picture

I am working on it.

garvitasakhrani’s picture

Status: Active » Needs review

I have fixed the reported PHPCS errors. I was unable to reproduce the warnings related to the .info.yml files.
The changes have been pushed to the issue fork branch 3573774-the-issues-reported.
Kindly review. Thank you!

paraderojether’s picture

Status: Needs review » Needs work

Hi

I reviewed MR! 131, and there are still remaining phpcs issues shown below.

Jether@PrometSources-MacBook-Pro-4 google_tag % curl https://git.drupalcode.org/project/google_tag/-/merge_requests/131.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3181    0  3181    0     0   2432      0 --:--:--  0:00:01 --:--:--  2433
patching file google_tag.info.yml
patching file google_tag.permissions.yml
patching file 'src/Plugin/GoogleTag/Event/Commerce/ViewItemList.php'
patching file 'tests/src/Kernel/PageAttachmentsHookTest.php'
Jether@PrometSources-MacBook-Pro-4 google_tag % cd ..
Jether@PrometSources-MacBook-Pro-4 contrib % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig google_tag

FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/modules/google_tag_test/google_tag_test.routing.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
------------------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/src/Nightwatch/TestCommerceSiteInstallTestScript.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 17 | WARNING | Class name must be prefixed with the project name "GoogleTag"
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/src/Nightwatch/TestSiteInstallTestScript.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 11 | WARNING | Class name must be prefixed with the project name "GoogleTag"
-----------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/src/Nightwatch/TestNoConfigSiteInstallTestScript.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 10 | WARNING | Class name must be prefixed with the project name "GoogleTag"
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/src/Form/TagContainerForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 287 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 319 | WARNING | #description values usually have to run through t() for translation
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/src/GoogleTagController.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------
 127 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 150 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/src/TagContainerListBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 39 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

Time: 566ms; Memory: 18MB

Jether@PrometSources-MacBook-Pro-4 contrib %

Kindly check and advise, please.
Thank you.

amangupta made their first commit to this issue’s fork.

garvitasakhrani’s picture

Status: Needs work » Needs review

I have addressed the remaining PHPCS warnings reported in comment #6.
Please review.

paraderojether’s picture

I reviewed MR!131 again, and there are still remaining PHPCS issues shown below:

Jether@PrometSources-MacBook-Pro-4 google_tag % curl https://git.drupalcode.org/project/google_tag/-/merge_requests/131.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11297    0 11297    0     0   5317      0 --:--:--  0:00:02 --:--:--  5318
patching file google_tag.info.yml
patching file google_tag.permissions.yml
patching file 'src/Form/TagContainerForm.php'
patching file 'src/GoogleTagController.php'
patching file 'src/Plugin/GoogleTag/Event/Commerce/ViewItemList.php'
patching file 'src/TagContainerListBuilder.php'
patching file 'tests/modules/google_tag_test/google_tag_test.routing.yml'
patching file 'tests/src/Kernel/PageAttachmentsHookTest.php'
patching file 'tests/src/Nightwatch/TestCommerceSiteInstallTestScript.php'
patching file 'tests/src/Nightwatch/TestNoConfigSiteInstallTestScript.php'
patching file 'tests/src/Nightwatch/TestSiteInstallTestScript.php'
patching file 'tests/src/Nightwatch/Tests/commerceEventsTest.js'
patching file 'tests/src/Nightwatch/Tests/integrationTest.js'
patching file 'tests/src/Nightwatch/Tests/userInterfaceTest.js'
Jether@PrometSources-MacBook-Pro-4 google_tag % cd ..
Jether@PrometSources-MacBook-Pro-4 contrib % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig google_tag

FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/src/Nightwatch/TestCommerceSiteInstallTestScript.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 17 | ERROR | Class name doesn't match filename; expected "class TestCommerceSiteInstallTestScript"
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/src/Nightwatch/TestSiteInstallTestScript.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 11 | ERROR | Class name doesn't match filename; expected "class TestSiteInstallTestScript"
-----------------------------------------------------------------------------------------------------------------


FILE: /Users/Jether/Q1/q1issues/web/modules/contrib/google_tag/tests/src/Nightwatch/TestNoConfigSiteInstallTestScript.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 10 | ERROR | Class name doesn't match filename; expected "class TestNoConfigSiteInstallTestScript"
-------------------------------------------------------------------------------------------------------------------------

Time: 528ms; Memory: 18MB

I will retain the status to Needs review so that others can review.
Thank you.

amangupta’s picture

Can you review the MR!132

jannakha’s picture

Status: Needs review » Needs work
StatusFileSize
new60.42 KB

can you enable phpcs in gitlab.yml so it actually runs on gitlab?
it's not running atm - it will be easier to see the results of phpcs if it runs on a branch too:
ci

japerry made their first commit to this issue’s fork.

  • japerry committed d228b1c1 on 2.0.x authored by amangupta
    Task: #3573774 "Fix phpcs, phpstan, cspell, and other linting issues"
    
japerry’s picture

Status: Needs work » Fixed

There was a bit of rework needed for D12 compatibility. But its fixed!

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.