- Issue created by @Andrii Momotov
- Assigned to Andrii Momotov
- Merge request !3Issue #3426884: Fix the errors/warnings reported by PHP_CodeSniffer ā (Open) created by Andrii Momotov
- Issue was unassigned.
- Status changed to Needs review
9 months ago 1:01pm 10 March 2024 - šŗš¦Ukraine Andrii Momotov
Fixed the errors/warnings reported by PHP_CodeSniffer.
Please review. Thanks! - Status changed to Needs work
9 months ago 1:29pm 10 March 2024 - šµšPhilippines clarkssquared
Hi
I applied MR !3 but there are still many PHPCS issues that needs to be resolved.
ā contrib git:(master) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml taxonomy_protect FILE: ...s/d9/d9-local/web/modules/contrib/taxonomy_protect/taxonomy_protect.module -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 1 | ERROR | [x] Missing file doc comment -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- FILE: ...d9/d9-local/web/modules/contrib/taxonomy_protect/taxonomy_protect.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: .../d9/d9-local/web/modules/contrib/taxonomy_protect/taxonomy_protect.install -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- FILE: ...les/contrib/taxonomy_protect/src/Form/TaxonomyProtectAdminSettingsForm.php -------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES -------------------------------------------------------------------------------- 32 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, | | use dependency injection instead 45 | WARNING | \Drupal calls should be avoided in classes, use dependency | | injection instead -------------------------------------------------------------------------------- Time: 236ms; Memory: 10MB ā contrib git:(master) ā cd taxonomy_protect ā taxonomy_protect git:(master) ā curl https://git.drupalcode.org/project/taxonomy_protect/-/merge_requests/3.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4166 0 4166 0 0 4991 0 --:--:-- --:--:-- --:--:-- 5025 patching file 'src/Form/TaxonomyProtectAdminSettingsForm.php' 2 out of 3 hunks failed--saving rejects to 'src/Form/TaxonomyProtectAdminSettingsForm.php.rej' patching file taxonomy_protect.install patching file taxonomy_protect.module ā taxonomy_protect git:(master) ā .. ā contrib git:(master) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml taxonomy_protect FILE: ...s/d9/d9-local/web/modules/contrib/taxonomy_protect/taxonomy_protect.module -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 1 | ERROR | [x] Missing file doc comment -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- FILE: ...d9/d9-local/web/modules/contrib/taxonomy_protect/taxonomy_protect.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: ...les/contrib/taxonomy_protect/src/Form/TaxonomyProtectAdminSettingsForm.php -------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------- 32 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, | | use dependency injection instead -------------------------------------------------------------------------------- Time: 95ms; Memory: 10MB ā contrib git:(master) ā
- šŗš¦Ukraine Andrii Momotov
Hi @clarkssquared
You are doing something wrong. I've checked several times and it doesn't show any more warnings or errors.For example, in your message, the first error says:
FILE: ...s/d9/d9-local/web/modules/contrib/taxonomy_protect/taxonomy_protect.module -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 1 | ERROR | [x] Missing file doc comment -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------
Please look at my MR:
https://git.drupalcode.org/project/taxonomy_protect/-/merge_requests/3/d...So you'll see, I added a doc comment to the taxonomy_protect.module file.
Thanks! - š®š³India Jasjeet Kaur Brar
Hiiee Andrii, These issues are already been taken care of in another ticket by me which was added by you for GitLab CI.
Can you please confirm from that ticket? And Thanks. - Status changed to Needs review
9 months ago 11:24am 11 March 2024 - š®š³India riddhi.addweb
I tried to apply the patch [MR3], but it failed when applied. Attaching a screenshot for the same.
- Status changed to Needs work
5 months ago 8:09am 10 July 2024