Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s pre-commit workflow by relocating the hook wrapper script and renaming Composer script entries used by the hook to run linting/analysis.
Changes:
- Point pre-commit hook entries to
tests/tools/pre-commit-check.sh. - Update
tests/tools/pre-commit-check.shpreflight/tool invocation logic. - Rename Composer scripts from
phpcsfixer/phpcsfixittophp-cs-fixer/php-cs-fixit.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/tools/pre-commit-check.sh |
Updates pre-commit wrapper logic and Composer script names. |
composer.json |
Renames Composer scripts for PHP CS Fixer. |
.pre-commit-config.yaml |
Re-points local hooks to the relocated script. |
Comments suppressed due to low confidence (4)
tests/tools/pre-commit-check.sh:101
- The tool load check is broken:
[ $($VENDOR_BIN/$tool --version > /dev/null 2>&1) -gt 0 ]uses command substitution (capturing stdout) and then performs a numeric comparison. Because stdout is redirected to /dev/null, the substitution expands to an empty string and the test errors (and withset -ewill abort the hook). Use a direct command-status check instead (e.g., negate the--versioninvocation) rather than trying to compare output to a number.
tests/tools/pre-commit-check.sh:115 - The
phplintavailability check is incorrect for the same reason ascheck_tool:[ $($VENDOR_BIN/phplint --version > /dev/null 2>&1) -gt 0 ]evaluates to an empty string and causes a failingtest. This will either break the hook or always fall back unexpectedly; prefer checking the command’s exit status directly.
tests/tools/pre-commit-check.sh:154 composer run-script php-cs-fixeris being executed inside$()and then compared with-gt 0, butcomposer run-scriptprints text to stdout and doesn’t output a numeric status. Withset -e, this will behave unpredictably and can fail with a "test: illegal number" error. Invoke the composer script normally and branch on its exit code instead.
tests/tools/pre-commit-check.sh:78- The message has a typo/grammar issue ("your are") and extra spacing, and it’s labeled as WARNING but exits non-zero (effectively an error). Consider correcting the wording ("you are") and either change the prefix to ERROR or don’t exit if it’s intended to be only a warning.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bmfmancini
approved these changes
Mar 27, 2026
xmacan
approved these changes
Mar 27, 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.
This change relocates the pre-commit-check.sh script and renames some composer run-script names.