- Issue created by @ptmkenny
- šÆšµJapan ptmkenny
The MR fixes as many of the simple issues as I could.
The remaining issues are as follows:
FILE: /var/www/html/web/modules/contrib/tome/modules/tome_static/src/Commands/StaticCommand.php ----------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------- 112 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ----------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/modules/tome_sync_autoclean/src/EventSubscriber/ExportEventSubscriber.php ---------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------------- 116 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ---------------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/tests/src/Functional/BookTest.php ------------------------------------------------------------------------------------------------ FOUND 4 ERRORS AFFECTING 4 LINES ------------------------------------------------------------------------------------------------ 120 | ERROR | Missing parameter type 122 | ERROR | Missing parameter type 124 | ERROR | Missing parameter type 126 | ERROR | Missing parameter type ------------------------------------------------------------------------------------------------ FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/JsonFileStorage.php --------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES --------------------------------------------------------------------------------------------- 25 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 32 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead --------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/EventSubscriber/ConfigEventSubscriber.php ------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES ------------------------------------------------------------------------------------------------------------ 42 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 55 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 67 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ------------------------------------------------------------------------------------------------------------ FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Form/ImportPartialForm.php ---------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES ---------------------------------------------------------------------------------------------- 195 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 241 | WARNING | Unused variable $i. 242 | WARNING | Unused variable $j. 268 | WARNING | Unused variable $translation. ---------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Form/CleanFilesForm.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 98 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 105 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 107 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 129 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 145 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Commands/DeleteContentCommand.php ---------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------- 87 | WARNING | Unused variable $translation. ---------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Commands/ImportCommand.php ---------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES ---------------------------------------------------------------------------------------------- 145 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 147 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 149 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ---------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/tome/modules/tome_base/tests/src/Kernel/TestBase.php ------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------------------- 39 | ERROR | Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations. -------------------------------------------------------------------------------------------------------------------------------------------------
I didn't handle the DI because I think that should be in a separate issue because it can break things. The other issues I wasn't sure how best to fix.
- Status changed to Needs review
over 1 year ago 3:43pm 1 May 2023 - Assigned to arpitk
- Status changed to Needs work
over 1 year ago 7:11pm 19 June 2023 - Issue was unassigned.
- Assigned to nitin_lama
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Issue was unassigned.
- š®š³India nitin_lama India
Fixed most of the errors/warning and committed changes on the MR. Remaining DI warning/errors are:
FILE: /home/system/Documents/contribution/tome-3339621/modules/tome_sync/tests/src/Functional/BookTest.php ---------------------------------------------------------------------------------------------------------- FOUND 4 ERRORS AFFECTING 4 LINES ---------------------------------------------------------------------------------------------------------- 120 | ERROR | Missing parameter type 122 | ERROR | Missing parameter type 124 | ERROR | Missing parameter type 126 | ERROR | Missing parameter type ---------------------------------------------------------------------------------------------------------- FILE: /home/system/Documents/contribution/tome-3339621/modules/tome_sync/modules/tome_sync_autoclean/src/EventSubscriber/ExportEventSubscriber.php -------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------------------------------- 116 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead -------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /home/system/Documents/contribution/tome-3339621/modules/tome_sync/src/JsonFileStorage.php ------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ------------------------------------------------------------------------------------------------ 25 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 32 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ------------------------------------------------------------------------------------------------ FILE: /home/system/Documents/contribution/tome-3339621/modules/tome_sync/src/EventSubscriber/ConfigEventSubscriber.php ---------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES ---------------------------------------------------------------------------------------------------------------------- 42 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 55 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 67 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ---------------------------------------------------------------------------------------------------------------------- FILE: /home/system/Documents/contribution/tome-3339621/modules/tome_base/tests/src/Kernel/TestBase.php ------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------------------- 39 | ERROR | Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations. ------------------------------------------------------------------------------------------------------------------------------------------------- Time: 702ms; Memory: 10MB
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Assigned to priyanka_chauhan31
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 3:33pm 17 August 2023 - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - š®š³India priyanka_chauhan31 Noida
Hi, Fixed some of the coding standard for it for branch- 8.x-1.x. Please review.
- šÆšµJapan ptmkenny
@priyanka_chauhan31 What did you fix? Also, please add your changes to the merge request. You can also add a patch, but multiple people have already contributed to the MR, so that should be the "upstream" for changes.
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
about 1 year ago Waiting for branch to pass - š®š³India priyanka_chauhan31 Noida
@ptmkenny
I have fixed some of the coding standard and inserted DI wherever it was possible. Attaching the above patch again. - Status changed to Needs work
about 1 year ago 1:18pm 4 September 2023 - š®š¹Italy apaderno Brescia, š®š¹
The warnings/errors are for 34 files, but the last patch changes 31 files.
Either the report shows more files than it should be corrected, or the patch corrects more files than necessary. - šÆšµJapan ptmkenny
@Shreyas gowda Please see my comment in #11:
What did you fix? Also, please add your changes to the merge request. You can also add a patch, but multiple people have already contributed to the MR, so that should be the "upstream" for changes.
- First commit to issue fork.
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
10 months ago Waiting for branch to pass - Status changed to Needs review
10 months ago 7:31am 9 February 2024 - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
10 months ago Waiting for branch to pass - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
10 months ago Waiting for branch to pass - Status changed to Needs work
6 months ago 12:44pm 24 May 2024 - šµšPhilippines cleavinjosh
Hi @pray_12,
I applied MR!8, it applied smoothly.
However, I still encountered some issues after I ran
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
.ā tome git:(ec6aae3) curl https://git.drupalcode.org/project/tome/-/merge_requests/8.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 66000 0 66000 0 0 67883 0 --:--:-- --:--:-- --:--:-- 67901 patching file modules/tome_base/src/ProcessTrait.php patching file modules/tome_base/tests/src/Kernel/TestBase.php patching file modules/tome_base/tests/src/Unit/ExecutableFinderTraitTest.php patching file modules/tome_static/modules/tome_static_super_cache/tome_static_super_cache.module patching file modules/tome_static/src/Commands/StaticCommand.php patching file modules/tome_static/src/EventSubscriber/EntityPathSubscriber.php patching file modules/tome_static/src/EventSubscriber/RedirectPathSubscriber.php patching file modules/tome_static/src/Form/StaticGeneratorForm.php patching file modules/tome_static/src/RequestPreparer.php patching file modules/tome_static/src/StaticGenerator.php patching file modules/tome_static/tests/modules/tome_test/tome_test.routing.yml patching file modules/tome_static/tests/src/Kernel/CollectPathsEventTest.php patching file modules/tome_static/tests/src/Kernel/ModifyDestinationEventTest.php patching file modules/tome_static/tests/src/Kernel/ModifyHtmlEventTest.php patching file modules/tome_sync/modules/tome_sync_autoclean/src/EventSubscriber/ExportEventSubscriber.php patching file modules/tome_sync/src/CleanFilesTrait.php patching file modules/tome_sync/src/Commands/CleanFilesCommand.php patching file modules/tome_sync/src/Commands/DeleteContentCommand.php patching file modules/tome_sync/src/Commands/ExportCommand.php patching file modules/tome_sync/src/Commands/ExportContentCommand.php patching file modules/tome_sync/src/Commands/ImportCommand.php patching file modules/tome_sync/src/Commands/ImportCompleteCommand.php patching file modules/tome_sync/src/Commands/ImportContentCommand.php patching file modules/tome_sync/src/Commands/ImportPartialCommand.php patching file modules/tome_sync/src/ContentHasher.php patching file modules/tome_sync/src/ContentIndexerTrait.php patching file modules/tome_sync/src/Event/ContentCrudEvent.php patching file modules/tome_sync/src/EventSubscriber/BookEventSubscriber.php patching file modules/tome_sync/src/EventSubscriber/ConfigEventSubscriber.php patching file modules/tome_sync/src/Exporter.php patching file modules/tome_sync/src/FileSync.php patching file modules/tome_sync/src/Form/CleanFilesForm.php patching file modules/tome_sync/src/Form/ImportPartialForm.php patching file modules/tome_sync/src/Importer.php patching file modules/tome_sync/src/JsonFileStorage.php patching file modules/tome_sync/src/TomeSyncHelper.php patching file modules/tome_sync/src/TomeSyncServiceProvider.php patching file modules/tome_sync/tests/src/Functional/BookTest.php patching file modules/tome_sync/tests/src/Functional/ImportPartialFormTest.php patching file modules/tome_sync/tests/src/Kernel/FileSyncTest.php patching file modules/tome_sync/tests/src/Kernel/ImporterTest.php patching file modules/tome_sync/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php patching file modules/tome_sync/tests/src/Unit/Normalizer/EntityReferenceItemNormalizerTest.php patching file modules/tome_sync/tests/src/Unit/Normalizer/FieldItemNormalizerTest.php patching file modules/tome_sync/tests/src/Unit/Normalizer/UserEntityNormalizerTest.php patching file tests/performance/create_articles.php ā tome git:(ec6aae3) ā .. ā contrib git:(main) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml tome FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/tome/modules/tome_static/src/Commands/StaticPreviewCommand.php --------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------------- 62 | ERROR | [x] Expected newline after closing brace --------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/tome/modules/tome_sync/drush.services.yml ------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------ 41 | 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-orgissue/web/modules/contrib/tome/modules/tome_sync/src/Form/ImportPartialForm.php ------------------------------------------------------------------------------------------------------------------------ FOUND 2 ERRORS AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------ 101 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 101 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line ------------------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------ FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/tome/modules/tome_sync/src/Commands/ImportCommand.php ------------------------------------------------------------------------------------------------------------------------ FOUND 2 ERRORS AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------ 93 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 93 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line ------------------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------ Time: 2.85 secs; Memory: 14MB ā contrib git:(main) ā
Thank you.
- Status changed to Needs review
6 months ago 12:58pm 24 May 2024 - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
6 months ago Waiting for branch to pass - šµšPhilippines cleavinjosh
I made a patch since the issues found can be fixed automatically by phpcbf.
Please review.
Thank you.
- šÆšµJapan ptmkenny
@cleavinjosh Thanks for working on this, but please add your changes to the MR; if you supply a patch, you need to also supply an interdiff to make it easier to review your changes.
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
6 months ago Waiting for branch to pass - šµšPhilippines cleavinjosh
cleavinjosh ā changed the visibility of the branch cleavinjosh-8.x-1.x-patch-59ba to hidden.
- š®š¹Italy apaderno Brescia, š®š¹
apaderno ā changed the visibility of the branch 8.x-1.x to hidden.
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
6 months ago Waiting for branch to pass - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.7last update
6 months ago Waiting for branch to pass - Status changed to Needs work
6 months ago 11:05am 30 May 2024 - Status changed to Needs review
4 months ago 7:06am 18 July 2024 - šµšPhilippines cleavinjosh
Hi,
I fixed these remaining issues that I found:
ā contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml tome FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/tome/modules/tome_static/src/Commands/StaticPreviewCommand.php ----------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------- 62 | ERROR | [x] Expected newline after closing brace ----------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/tome/modules/tome_sync/drush.services.yml -------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------- 41 | 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/tome/modules/tome_sync/src/Form/ImportPartialForm.php -------------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------- 101 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 101 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line -------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/tome/modules/tome_sync/src/Commands/ImportCommand.php -------------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------- 93 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 93 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line -------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------- Time: 3.05 secs; Memory: 14MB ā contrib
Please review.
Thank you.