Ship the shared pre-push hook [ignore_release] - #95
Merged
Merged
Conversation
Byte-identical to hooks/pre-push in matomo-org/plugin-ci-workflows, with verify-hook turned on so the copy cannot drift from it silently. The hook dispatches on phpstan/phpstan.created.neon and phpstan.modified.neon and silently analyses nothing without them, so both ship alongside it.
lachiebol
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the shared pre-push hook, which runs PHPStan over the PHP files a push touches so an analysis failure surfaces before CI rather than after it. The file is a byte-identical copy of
hooks/pre-pushinmatomo-org/plugin-ci-workflows(blob7d06e117), andverify-hook: trueturns on the Plugins CI job that diffs it against that canonical copy, so it cannot drift silently.The hook dispatches on
phpstan/phpstan.created.neonandphpstan/phpstan.modified.neonand analyses nothing at all without them, so both ship alongside it. Created files are held at level 9, since a new file carries no pre-existing debt; touched files at level 5. Both include the plugin's existingphpstan.neon, so CI is unaffected.Note that shipping the hook does not by itself switch it on: it runs only once
core.hooksPathpoints at.git-hooks-matomoin a given clone, whichadd-git-hooks-to-plugins.shdoes for plugins that already have the directory.Issue No
Related to PG-4897
Steps to Replicate the Issue
Not applicable — this adds tooling rather than fixing a defect.
Checklist