Problem/Motivation
Checking PHPCS with Drupal standard on core's module return:
FILE: ...dules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerSettingsTest.php
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
14 | ERROR | Missing member variable doc comment
------------------------------------------------------------------------------
FILE: ...rojects/core10/core/modules/tracker/tests/src/Functional/TrackerTest.php
------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
------------------------------------------------------------------------------
58 | ERROR | [x] Missing function doc comment
63 | ERROR | [ ] The array declaration extends to column 103 (the limit
| | is 80). The array content should be split up over
| | multiple lines
96 | ERROR | [ ] The array declaration extends to column 204 (the limit
| | is 80). The array content should be split up over
| | multiple lines
182 | ERROR | [ ] The array declaration extends to column 204 (the limit
| | is 80). The array content should be split up over
| | multiple lines
209 | ERROR | [ ] The array declaration extends to column 204 (the limit
| | is 80). The array content should be split up over
| | multiple lines
335 | WARNING | [x] There must be no blank line following an inline comment
338 | WARNING | [x] There must be no blank line following an inline comment
468 | ERROR | [x] Parameter comment must end with a full stop
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------
FILE: ...re10/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
36 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------
FILE: /home/tra/projects/core10/core/modules/tracker/tracker.module
------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------
93 | WARNING | [x] There must be no blank line following an inline comment
266 | ERROR | [ ] Type hint "\Drupal\node\NodeInterface" missing for $node
323 | WARNING | [x] There must be no blank line following an inline comment
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------
Steps to reproduce
Just run
phpcs --standard=Drupal --extensions=module,php,yml,twig,html core/modules/tracker
Proposed resolution
Fix it
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | interdiff_7-10.txt | 427 bytes | mrinalini9 |
| #10 | 3342301-10.patch | 8.41 KB | mrinalini9 |
| #9 | 3342301_7-9.txt | 576 bytes | _pratik_ |
| #9 | 3342301-9.patch | 8.58 KB | _pratik_ |
| #7 | 3342301-7.patch | 8.12 KB | akram khan |
Issue fork tracker-3342301
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
Comment #2
tra.duong commentedComment #3
tra.duong commentedI add patch to fix the PHPCS, please review
Comment #4
arunkumarkComment #5
arunkumarkThe patch applied cleanly but there are few Coding standard issues.
Comment #6
arunkumarkComment #7
akram khanUpdated patch fixed remaining PHPCS error left with 1 warning that is "423 | WARNING | Unused variable $unpublished."
Comment #8
arunkumarkApplied the patch, It applies cleanly. But there is one unresolved warning on the TrackerTest.php
Comment #9
_pratik_Please review thanks.
Comment #10
mrinalini9 commentedChanges in patch #9 doesn't seems correct, why remove the node creation part?
Added patch by fixing warnings in #8, please review it.
Thanks!
Comment #11
arunkumarkThe patch was applied cleanly and resolved all the PHPCS issues.
Comment #12
arunkumarkComment #14
urvashi_vora commentedHi,
I reviewed and tested patch #10. Worked fine for me.
Applied smoothly.
Thanks for the work.
Committing the changes for helping the maintainers.
Comment #16
avpadernoComment #17
avpadernoComment #19
batigolixI fixed a remaining phpcs issue. This can be tested. Pipeline passes on the phpcs step
Comment #20
batigolixGitlab CI was added some time ago, and this fails on phpcs, phpstan and phpunit.
I propose to fix this together in this issue, so other issues can use the pipeline for tests.
Comment #21
batigolixComment #22
batigolixComment #23
batigolixComment #24
batigolixI can get the phpunit tests working locally but not in the gitlab CI. So I revert any changes that are related to phpunit.
I made one change for phpcs.
This can be reviewed: phpcs passes in the gitlab CI pipeline.
Comment #25
adwivedi008 commentedAs the issue is for PHPCS and the pipeline passes all PHPCS issue, we can move the issue to RTBC and can create another linked issue for phpunit tests
moving the issue to RTBC
Comment #26
batigolix