- Issue created by @mondrake
- 🇮🇹Italy mondrake 🇮🇹
After some headache, now found the right regex to have sed adjust the paths of the generated baseline so it can be really just copy/pasted to the branch with no additional edit.
- 🇳🇱Netherlands bbrala Netherlands
I actually ran into this issue earlier today by chance (the paths not being correct).
This looks good and will make some things easier, but also allow for a good interface in gitlab for changes as per 📌 [CI] Report PHPStan baseline statistics in job Active .
All good, working as intended :)
The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇳🇱Netherlands bbrala Netherlands
As per Alex, we need a comment there, i understand it feels fragile, unfortunately a result of how things are run.
- 🇺🇸United States smustgrave
Actually just reviewed a ticket that could of used this so perfect timing!
Believe feedback for a comment has been added so going to mark it.
- 🇬🇧United Kingdom longwave UK
I tried to commit this but it's breaking the pre-commit script:
Running PHPStan on changed files. ------ ----------------------------------------------------------------------- Line ------ ----------------------------------------------------------------------- 408 Syntax error, unexpected '"' on line 408 408 Syntax error, unexpected T_STRING on line 408 409 Syntax error, unexpected T_NS_SEPARATOR on line 409 409 Syntax error, unexpected T_STRING on line 409 426 Syntax error, unexpected T_LNUMBER on line 426 450 Syntax error, unexpected T_STRING on line 450 451 Syntax error, unexpected T_STRING on line 451 479 Syntax error, unexpected T_STRING on line 479 480 Syntax error, unexpected T_STRING on line 480 514 Syntax error, unexpected '.' on line 514 555 Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 555 555 Syntax error, unexpected T_STRING on line 555 556 Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 556 556 Syntax error, unexpected T_STRING on line 556 557 Syntax error, unexpected '"', expecting '-' or T_STRING or T_VARIABLE or T_NUM_STRING on line 557 557 Syntax error, unexpected T_STRING, expecting T_VARIABLE or T_ENCAPSED_AND_WHITESPACE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN on line 557
I think because line 406 has the PHP open tag:
echo "<?php return [];" > ./core/.phpstan-baseline.php
then PHPStan tries to interpret the YAML as PHP and it all goes wrong. Either we need to tell PHPStan to ignore this file, or remove the open tag, or break it up into two parts so PHPStan can't see it?
- 🇮🇹Italy mondrake 🇮🇹
Why on earth is that script trying to have PHPStan scan
.gitlab-ci.yml
?Is
core/scripts/dev/commit-code-check.sh
the culprit? If it is, then it's probably because if PHPStan is passed a list of file paths, it's skipping the file discovery based on its configuration and just scan them all. So that script need change to only pass files with php/module/inc/etc. extensions. - 🇮🇹Italy mondrake 🇮🇹
OK, let's revert to prior https://git.drupalcode.org/project/drupal/-/merge_requests/10903/diffs?c... and see if that could fit.
- Status changed to RTBC
13 days ago 10:55pm 19 March 2025 - 🇺🇸United States smustgrave
With all the recent rebasing people have to do around the baseline it would be nice to get this one in please :)