composer-git-hooks icon indicating copy to clipboard operation
composer-git-hooks copied to clipboard

`stop-on-failure` has no effect

Open hmingv opened this issue 3 years ago • 2 comments

When the hook is a sequence of commands, execution is not stopped when the command fails.

When the first command fails, it proceeds to the next command, and if the next command did not fail, completes the commit.

image

image

hmingv avatar Aug 05 '22 01:08 hmingv

any updates on this? does not work for me either :-(

template-provider avatar May 24 '23 09:05 template-provider

Alternatively you can explicitly exit the individual commands. Not a fix, but a workaround for now:

"pre-commit": [
    "composer phpcs $(git diff --staged --name-only --diff-filter=ACM) || exit 1",
    "gitleaks protect -v --staged || exit 1"
]

Wotts avatar Sep 26 '23 14:09 Wotts