Skip to content

Fix PHP staged targets in docker mode (v2.2.9)#45

Merged
AntonioCS merged 1 commit intomainfrom
fix/staged-files-docker-mode
Jan 5, 2026
Merged

Fix PHP staged targets in docker mode (v2.2.9)#45
AntonioCS merged 1 commit intomainfrom
fix/staged-files-docker-mode

Conversation

@AntonioCS
Copy link
Owner

Summary

  • Fix: php/phpcs/staged, php/phpstan/staged, php/psalm/staged were broken in docker mode
  • Root cause: mb_run_on_staged appended files outside docker shell quotes
  • Solution: New php_run_on_staged helper passes files inside the invoke call
  • Add mb_staged_strip_prefix config for aligning git paths with container paths

Changes

  • core/util/git.mk: Add mb_staged_strip_prefix config
  • modules/php/php/php.mk: Add php_run_on_staged helper
  • modules/php/phpcs/phpcs.mk: Use new helper
  • modules/php/phpstan/phpstan.mk: Use new helper
  • modules/php/psalm/psalm.mk: Use new helper
  • templates/config.tpl.mk: Add config options with examples

Test plan

  • Run php/phpcs/staged in docker mode with staged PHP files
  • Verify mb_staged_strip_prefix strips paths correctly

- Add mb_staged_strip_prefix config to align git paths with container paths
- Add php_run_on_staged helper that passes files inside docker invoke
- Update phpcs/phpstan/psalm staged targets to use new helper
- Add config options to templates/config.tpl.mk
@AntonioCS AntonioCS merged commit 914fed2 into main Jan 5, 2026
1 check passed
@AntonioCS AntonioCS deleted the fix/staged-files-docker-mode branch January 5, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant