Problem/Motivation
There is a files need to fixed with coding standards.
Here is the command : -
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml web/modules/contrib/config_pages/
Result :-
FILE: ...rojects/d9/d9-local/web/modules/contrib/config_pages/config_pages.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: ...dules/contrib/config_pages/src/Plugin/Condition/ConfigPagesValueAccess.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
--------------------------------------------------------------------------------
217 | WARNING | Unused variable $cp_type.
217 | WARNING | Unused variable $data_type.
--------------------------------------------------------------------------------
FILE: .../web/modules/contrib/config_pages/src/Controller/ConfigPagesController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
169 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
FILE: ...s/d9/d9-local/web/modules/contrib/config_pages/src/ConfigPagesTypeForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
118 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
Time: 858ms; Memory: 12MB
Steps to reproduce
Run PHPCS on Config Pages module.
Proposed resolution
Fixed the coding standards.
Remaining tasks
Submit the patch either MR .
Comments
Comment #3
chandansha commentedfixed all issue. But still there are some issues left.
Please have a look.
Comment #4
clarkssquared commentedHi
I applied MR !36 and I confirmed that it fixes most of the PHPCS issues stated above, but since there are few remaining PHPCS issues I will move this ticket to needs work so that all PHPCS issues will be resolved.
Comment #5
zkhan.aamir commentedIssue summary updated.
Comment #7
sakthi_dev commentedFixed the remaining issues. Please review.
Comment #8
yashaswi18 commentedHello, I checked out to the branch '3424331-fix-the-issues' and ran the command phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml.
Found no errors or warnings remaining.
Comment #9
paraderojether commentedHi sakthi_dev,
I reviewed MR!36, and the MR is not applied cleanly I tried git apply -v and patch -p1 but I'm getting the error shown below:
Kindly check and advise, please.
Thank you.
Comment #10
sakthi_dev commentedI couldn't find the variables in the file. Could you please reverify it once please?
Comment #11
chandansha commentedI checked module i could not find any phpcs issue.
below share image kindly check.
@all Thanks for Review.
Comment #12
clarkssquared commentedHi
I apply the updated MR !36 into the module and it applied successfully, but when I try to execute the PHPCS command, I can also see the same phpcs issue that comment #9
Comment #16
silvi.addweb commentedHi, I have fixed below remaining phpcs issue. Please review.
Comment #17
akashpj commentedHi, I’ve reviwed MR 36 on Drupal 10.2.x.
The MR applied cleanly.
Few phpcs issues fixed but I still can see the below issues
Changing the status back to "Needs work".
Thanks
Comment #18
silvi.addweb commentedHi,
After applying the MR, I have not found any issues in the
ConfigPagesValueAccess.phpfile.Here is the command I used to run PHP CodeSniffer:
To avoid issues with the info file, please download the module through:
git clone repo-urlMove to "Need review" so other users can review as well.
Comment #20
enchufeUpdated PR branch from
origin/8.x-2.xComment #22
deimos commentedI added a basic .gitlab-ci.yml for automatic phpcs checking what might help for task review. Additionally it checks other code styles (for css, js) and run tests.
Comment #23
shumer commented