- Issue created by @apaderno
- Merge request !82Issue #3445394: Fix the PHP_CodeSniffer issues reported by GitLab CI ā (Merged) created by apaderno
- Status changed to Needs review
10 months ago 8:09am 6 May 2024 - Status changed to Needs work
7 months ago 12:08pm 31 July 2024 - šµšPhilippines cleavinjosh
Hi @avpaderno,
I applied MR!82, it was not applied smoothly and fixed most of the phpcs issues.
These are the remaining issues I encountered after I ran
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
.ā entity_usage git:(8.x-2.0-beta13) curl https://git.drupalcode.org/project/entity_usage/-/merge_requests/82.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 28254 0 28254 0 0 53636 0 --:--:-- --:--:-- --:--:-- 53714 patching file entity_usage.install patching file entity_usage.module patching file entity_usage.post_update.php Hunk #1 FAILED at 2. 1 out of 1 hunk FAILED -- saving rejects to file entity_usage.post_update.php.rej patching file src/Commands/EntityUsageCommands.php patching file src/Controller/ListUsageController.php Hunk #1 succeeded at 12 (offset 1 line). Hunk #2 succeeded at 78 (offset 1 line). Hunk #3 succeeded at 121 (offset 1 line). patching file src/EntityUpdateManager.php patching file src/EntityUpdateManagerInterface.php patching file src/EntityUsage.php patching file src/EntityUsageBatchManager.php Hunk #1 FAILED at 2. Hunk #2 succeeded at 68 (offset 2 lines). Hunk #3 succeeded at 110 (offset 2 lines). Hunk #4 succeeded at 153 (offset 2 lines). 1 out of 4 hunks FAILED -- saving rejects to file src/EntityUsageBatchManager.php.rej patching file src/EntityUsageTrackBase.php patching file src/Form/BatchUpdateForm.php patching file src/Form/EntityUsageSettingsForm.php Hunk #1 succeeded at 233 (offset 9 lines). patching file src/Plugin/EntityUsage/Track/BlockField.php patching file src/Plugin/EntityUsage/Track/CkeditorImage.php patching file src/Plugin/EntityUsage/Track/EntityEmbed.php patching file src/Plugin/EntityUsage/Track/LayoutBuilder.php patching file src/Plugin/EntityUsage/Track/LinkIt.php patching file src/Plugin/EntityUsage/Track/MediaEmbed.php patching file src/Plugin/QueueWorker/EntityUsageRegenerateTrackingInfoWorker.php Reversed (or previously applied) patch detected! Assume -R? [n] n Apply anyway? [n] n Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file src/Plugin/QueueWorker/EntityUsageRegenerateTrackingInfoWorker.php.rej patching file tests/modules/entity_usage_test/src/Plugin/Block/DependenciesBlock.php patching file tests/src/FunctionalJavascript/EmbeddedContentTest.php patching file tests/src/FunctionalJavascript/EntityUsageLayoutBuilderEntityBrowserBlockTest.php patching file tests/src/FunctionalJavascript/IntegrationTest.php patching file tests/src/Kernel/EntityUsageTest.php patching file tests/src/Kernel/EntityUsageTrackFileTest.php ā entity_usage git:(8.x-2.0-beta13) ā .. ā contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml entity_usage FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/tests/modules/entity_usage_test/config/install/field.storage.node.field_eu_test_related_nodes.yml ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 18 | ERROR | [x] Expected 1 newline at end of file; 0 found ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/tests/src/Kernel/EntityUsageTest.php -------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityInterface. 116 | WARNING | [ ] Unused variable $source_vid. 182 | WARNING | [ ] Unused variable $storage. -------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/tests/src/Kernel/EntityUsageTrackFileTest.php ------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------- 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\entity_test\Entity\EntityTest. ------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/entity_usage.module ----------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------- 119 | WARNING | [x] A comma should follow the last multiline array item. Found: ) 120 | WARNING | [x] A comma should follow the last multiline array item. Found: ] ----------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/entity_usage.post_update.php ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5 | ERROR | [x] Doc comment short description must start with a capital letter 10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Site\Settings. 13 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", | | "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates." 14 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/src/EntityUsageInterface.php ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 4 ERRORS AND 1 WARNING AFFECTING 3 LINES ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 163 | WARNING | Line exceeds 80 characters; contains 90 characters 197 | ERROR | The text '@deprecated in branch 2.x. Use \Drupal\entity_usage\EntityUsageInterface::listSources() instead.' does not match the standard format: @deprecated in | | %deprecation-version% and is removed from %removal-version%. %extra-info%. 197 | ERROR | Each @deprecated tag must have a @see tag immediately following it 219 | ERROR | The text '@deprecated in branch 2.x. Use \Drupal\entity_usage\EntityUsageInterface::listTargets() instead.' does not match the standard format: @deprecated in | | %deprecation-version% and is removed from %removal-version%. %extra-info%. 219 | ERROR | Each @deprecated tag must have a @see tag immediately following it ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/src/Plugin/EntityUsage/Track/BlockField.php ----------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------- 37 | WARNING | Unused variable $display_id. ----------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/src/EntityUsageBatchManager.php ----------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------- 115 | WARNING | [x] A comma should follow the last multiline array item. Found: ] ----------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/entity_usage/src/Commands/EntityUsageCommands.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- Time: 2.93 secs; Memory: 16MB ā contrib
Please check and advise.
Thank you. - Assigned to kulpratap2002
- š®š³India arunsahijpal
Hi @cleavinjosh and @marcoscano,
I've removed all the phpcs errors , please check it once. - š®š³India chandansha
I have tested MR 82 using @cleavinjosh given command there is still some of issue pending.
I move it to Need Work.
ThankS!! - š®š³India chandansha
@arunsahijpal sorry I have tested it on my local phpcs. In Pipeline are run successfully passed.
I move it to RTBC
Thanks!! - š¬š§United Kingdom alexpott šŖšŗš
We should add
phpcs: allow_failure: false
to the .gitlab-ci.yml file and then we'll fail a build when a change causes PHPCS to fail.
- š®š³India arunsahijpal
Hi @alexpott,
I've allowed phpcs failure and the phpcs is also passing the pipeline, kindly check. - šŖšøSpain marcoscano Barcelona, Spain
Thanks for helping! This is ready to go but needs a re-roll
- First commit to issue fork.
-
marcoscano ā
committed 05ad6de2 on 8.x-2.x authored by
avpaderno ā
Issue #3445394 by arunsahijpal, avpaderno, alexpott, kul.pratap,...
-
marcoscano ā
committed 05ad6de2 on 8.x-2.x authored by
avpaderno ā
Automatically closed - issue fixed for 2 weeks with no activity.