Skip to content

php-lint hook only inspects one file #13

Description

@avdv

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions