Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php-lint hook only inspects one file #13

Open
avdv opened this issue Mar 16, 2021 · 0 comments
Open

php-lint hook only inspects one file #13

avdv opened this issue Mar 16, 2021 · 0 comments

Comments

@avdv
Copy link

avdv commented Mar 16, 2021

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 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.

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

No branches or pull requests

1 participant