Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 03fa6ac

Browse files
steveworleygrasmash
authored andcommitted
Ensure correct exit status on pre-commit (#523)
Pre-commit should return the status of the executed phing target, this will prevent code from being committed that doesn't meet the minimum requirements for the project. These checks can be skipped by specifying the `--no-verify` option when comitting.
1 parent 645df6e commit 03fa6ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/git-hooks/pre-commit

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ if [ ! -f $PHPCS_BIN ];
1313
fi
1414

1515
${ROOT_DIR}/vendor/bin/blt validate:phpcs:files -Dfiles="$LIST" -q
16-
exit 0;
16+
17+
# Return the status of the phing task. Any target executed should throw a build exception to prevent
18+
# code from being committed during the precommit. The hooks can be skipped by adding `--no-verify` to
19+
# a commit.
20+
exit $?

0 commit comments

Comments
 (0)