- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This came up again, because of π Fix PHPStan violations (happened because PHPStan code checks stopped runningβ¦) Fixed . Let's make this happen π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I've fixed π Fix cspell use: specify globRoot and always pass --root to cspell Fixed . Please review, so we can move forward here :)
- Status changed to Needs work
over 1 year ago 10:44am 9 March 2023 - @xjm opened merge request.
- First commit to issue fork.
- Status changed to Needs review
over 1 year ago 3:54pm 23 May 2023 - last update
over 1 year ago 29,367 pass, 2 fail - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Rather than recreating this MR to target
11.x
, I'm just uploading it as a patch. (Also, the conflict that π Fix cspell use: specify globRoot and always pass --root to cspell Fixed caused was not resolved correctly in the existing MR. π But it's tricky!)Also because creating a new branch endlessly tells me π€ͺπ¬π¬
This patch correctly resolves the conflict: π Fix cspell use: specify globRoot and always pass --root to cspell Fixed already did everything we needed! π
- last update
over 1 year ago 29,390 pass - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
+++ b/core/scripts/dev/commit-code-check.sh @@ -109,6 +109,8 @@ +DRUPAL_ROOT=${DRUPAL_ROOT:="$TOP_LEVEL"}
We can do better than this I think.
This means that you would have to first
cd
into the contrib module and then specify the Drupal root manually:cd modules/contrib/cdn DRUPAL_ROOT=<SOMETHING> sh ../../../core/scripts/dev/commit-code-check.sh
β¦ but the script is already in Drupal core. So why don't we use that to determine the Drupal root? π€
- Assigned to wim leers
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
#13 works fine:
$ sh ../../../core/scripts/dev/commit-code-check.sh /Users/wim.leers/core/modules/contrib/automatic_updates 1/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3347584-2.patch 170.51ms 2/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3350457-2.patch 4.88ms 3/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568-10.patch 5.31ms 4/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568-11.patch 5.46ms 5/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568-18.patch 14.84ms 6/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568.patch 3.15ms 7/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3351895-41-update-core-MR-converter-do-not-test.patch 2.38ms 8/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3351895-41-update-core-MR-converter.patch 1.85ms 9/13 /Users/wim.leers/core/modules/contrib/automatic_updates/3354914-5.patch 5.33ms 10/13 /Users/wim.leers/core/modules/contrib/automatic_updates/drupalci.yml 4.82ms 11/13 /Users/wim.leers/core/modules/contrib/automatic_updates/f 2.96ms 12/13 /Users/wim.leers/core/modules/contrib/automatic_updates/mirror.patch 10.13ms 13/13 /Users/wim.leers/core/modules/contrib/automatic_updates/next 1.95ms CSpell: Files checked: 13, Issues found: 0 in 0 files CSpell: passed
Note that
cSpell
automatically picked up the.cspell.json
in that module (i.e. the current working directory)!Contrast that with:
$ sh ../../../core/scripts/dev/commit-code-check.sh 1/22 /Users/wim.leers/core/modules/contrib/cdn/.phpcs-cache 279.23ms X /Users/wim.leers/core/modules/contrib/cdn/.phpcs-cache:1:9746 - Unknown word (Validatable) /Users/wim.leers/core/modules/contrib/cdn/.phpcs-cache:1:415639 - Unknown word (Farfuture) /Users/wim.leers/core/modules/contrib/cdn/.phpcs-cache:1:440137 - Unknown word (Farfuture) β¦ /Users/wim.leers/core/modules/contrib/cdn/tests/src/Functional/CdnIntegrationTest.php:207:55 - Unknown word (Farfuture) /Users/wim.leers/core/modules/contrib/cdn/tests/src/Functional/CdnIntegrationTest.php:220:27 - Unknown word (Farfuture) CSpell: Files checked: 22, Issues found: 95 in 17 files CSpell: failed
That module does not have a
.cspell.json
πNext up:
phpstan
. - last update
over 1 year ago Build Successful - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
First let's stop running all tests, we only want the commit checks. Let's save some DrupalCI cycles π
- last update
over 1 year ago 188 pass - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Apparently we need some test results for it to succeed.
- last update
over 1 year ago 188 pass - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Now also works for
phpstan
:$ sh ../../../core/scripts/dev/commit-code-check.sh 1/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3347584-2.patch 173.93ms 2/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3350457-2.patch 4.57ms 3/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568-10.patch 5.71ms 4/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568-11.patch 5.59ms 5/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568-18.patch 15.23ms 6/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3350568.patch 3.29ms 7/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3351895-41-update-core-MR-converter-do-not-test.patch 2.75ms 8/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3351895-41-update-core-MR-converter.patch 1.87ms 9/14 /Users/wim.leers/core/modules/contrib/automatic_updates/3354914-5.patch 3.47ms 10/14 /Users/wim.leers/core/modules/contrib/automatic_updates/drupalci.yml 9.52ms 11/14 /Users/wim.leers/core/modules/contrib/automatic_updates/f 2.94ms 12/14 /Users/wim.leers/core/modules/contrib/automatic_updates/mirror.patch 6.17ms 13/14 /Users/wim.leers/core/modules/contrib/automatic_updates/next 2.00ms 14/14 /Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php 48.94ms CSpell: Files checked: 14, Issues found: 0 in 0 files CSpell: passed ---------------------------------------------------------------------------------------------------- Running PHPStan on *all* files. [OK] No errors PHPStan: passed
π This means it works, because if it were using core's
phpstan.neon.dist
, it would fail: there's additionalignoreErrors
entries! π₯³ The last submitted patch, 12: 3314100-12.patch, failed testing. View results β
- Issue was unassigned.
- last update
over 1 year ago Custom Commands Failed - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
And now everything else:
phpcs
- And under
for FILE in $FILES; do
, running:stat permissions checks
phpcs on YAML
eslint
PCSS β CSS compiling
π
Specifically skipped for non-core projects, because they're highly specific to Drupal core:
yarn run -s lint:core-js-passing
yarn run -s lint:css
yarn run -s check:ckeditor5
yarn run build:css --check
And under
for FILE in $FILES; do
, skipped these:# Don't commit changes to vendor.
# Don't commit changes to core/node_modules.
-
phpcs on PHP files/code> β because we've already scanned <em>everything</em> above, so no more need to scan one-by-one!</li> </ol> Resulting output: <code> $ sh ../../../core/scripts/dev/commit-code-check.sh 1/3 /Users/wim.leers/core/modules/contrib/automatic_updates/drupalci.yml 175.53ms 2/3 /Users/wim.leers/core/modules/contrib/automatic_updates/next 4.37ms 3/3 /Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php 55.63ms CSpell: Files checked: 3, Issues found: 0 in 0 files CSpell: passed ---------------------------------------------------------------------------------------------------- Running PHPStan on *all* files. [OK] No errors PHPStan: passed ---------------------------------------------------------------------------------------------------- ............................................................ 60 / 332 (18%) ............................................................ 120 / 332 (36%) .....S...................................................... 180 / 332 (54%) ............................................................ 240 / 332 (72%) ............................................................ 300 / 332 (90%) ................................ 332 / 332 (100%) Time: 2.81 secs; Memory: 20MB PHPCS: passed ---------------------------------------------------------------------------------------------------- Checking next next passed ---------------------------------------------------------------------------------------------------- Checking drupalci.yml ESLint: drupalci.yml passed drupalci.yml passed ---------------------------------------------------------------------------------------------------- Checking package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php passed ----------------------------------------------------------------------------------------------------
π this means that
modules/contrib/automatic_updates/drupalci.yml
could use:container_command.commit-checks: commands: - ../../../core/scripts/dev/commit-code-check.sh --drupalci halt-on-fail: true
β¦ and that's all it would take for a contrib module to adopt this!
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
While the original title was accurate, I think this title better reflects the ecosystem impact this is aiming at! π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Adding a second and third example to the issue summary.
- last update
over 1 year ago Custom Commands Failed - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I got something wrong in the PHPStan one.
- Status changed to Needs work
over 1 year ago 3:05pm 24 May 2023