You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AFAIUI, a 'system' hook is simply given all staged file names as arguments.
Now, php -l interprets the first argument as the file to inspect, any other subsequent arguments are just arguments and thus ignored. (I was once bitten by this, thinking I could just check my PHP files with find -name '*.php' | xargs -r php -l but that does not work for the same reason)
So, running pre-commit run php-lint --all-files does always return success if the first file happens to be syntactically correct, but misses any errors in all other files.
The text was updated successfully, but these errors were encountered:
Hi.
AFAIUI, a 'system' hook is simply given all staged file names as arguments.
Now,
php -l
interprets the first argument as the file to inspect, any other subsequent arguments are just arguments and thus ignored. (I was once bitten by this, thinking I could just check my PHP files withfind -name '*.php' | xargs -r php -l
but that does not work for the same reason)So, running
pre-commit run php-lint --all-files
does always return success if the first file happens to be syntactically correct, but misses any errors in all other files.The text was updated successfully, but these errors were encountered: