Fixed
Project:
Drupal core
Version:
11.5.x-dev
Component:
other
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2026 at 17:37 UTC
Updated:
13 Nov 2026 at 08:07 UTC
Jump to comment: Most recent
Committing https://www.drupal.org/project/drupal/issues/3624887 is hard because commit-code-check.sh fails because the file that's changed is excluded from PHPStan.
Use commit code check on an issue which only changes .api.php file.
There's no easy way to ignore this error. We have to catch the error and do a text match.
None
None
None
None
N/a
I used AI to help code the fix.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
alexpottComment #4
alexpottTested locally - works a charm...
Comment #5
xjmNot to scope-creep, but I think PHPCS has the same issue? There are a number of recent changes related to PHPStan that I was only able to commit with
--no-verify.Comment #6
xjmI confirmed that #3624887: Remove obsolete hook_extension() and hook_render_template() documentation fails with:
...and passes with the diff from this issue committed first.
Examples of issues that needed a
--no-verifyfor PHPCS:Not sure if we want to file a separate issue for that (everyone claims it exists but I never found one) or make some sort of change to how the script works that would resolve this for PHPCS as well.
Comment #7
alexpott@xjm let's fix the PHPCS thing here too... seems like a good thing to do
Comment #8
alexpottActaully the PHPCS thing was fixed by #3574117: Improve commit-code-check.sh so we're all good here.
Comment #9
alexpottAh I see why the PHPCS is not 100% fixed... it's core/.baseline.php ending up in $PHP_FILES
Comment #10
mstrelan commentedTested this in three scenarios, when there are no files to scan, when there are no violations and when there are violations. All seemed fine, only one cosmetic problem, if there are no files to scan it outputs
[ERROR] No files found to analysefollowed byPHPStan: passed, which I think is good enough.Comment #11
quietone commented@mstrelan, beat me to this. Nonetheless here is what I did.
I applied the diff, made a change to core.api.php and ran the commit-code-check. There were no failures
I removed those changes and added a blank line to core/.phpstan-baseline.php and ran the commit-code-check. There were no failures.
I then add a PHPCS error to Concat.php and ran commit-code-check. PHPCS reported the error, so nothing broken there.
This is really nice to have fixed, Thanks!
Comment #16
catchCommitted/pushed to main and cherry-picked back through to 11.5.x, thanks!