mirror of https://github.com/zulip/zulip.git
20 lines
492 B
Plaintext
20 lines
492 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
# This hook runs gitlint on your commit message.
|
||
|
|
||
|
# If your machine contains a provisioned Zulip development environment, the
|
||
|
# linter will be invoked through `vagrant ssh`.
|
||
|
|
||
|
lint_cmd="cd ~/zulip && cat \"$1\" | python -m gitlint.cli"
|
||
|
if [ -z "$VIRTUAL_ENV" ] && `which vagrant > /dev/null` && [ -e .vagrant ]; then
|
||
|
vagrant ssh -c "$lint_cmd"
|
||
|
else
|
||
|
$lint_cmd
|
||
|
fi
|
||
|
|
||
|
if [ $? -ne 0 ]; then
|
||
|
echo "WARNING: Your commit message does not match Zulip's style guide."
|
||
|
fi
|
||
|
|
||
|
exit 0
|