2016-08-17 22:03:54 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This hook runs the Zulip code linter ./tools/lint-all and returns true
|
|
|
|
# regardless of linter results so that your commit may continue.
|
|
|
|
|
|
|
|
# Messages from the linter will be printed out to the screen.
|
|
|
|
#
|
|
|
|
# If you are running this one machine hosting a Vagrant guest that
|
|
|
|
# contains your provisioned Zulip development environment, the linter
|
|
|
|
# will automatically be run through `vagrant ssh`.
|
|
|
|
|
|
|
|
if [ -z "$VIRTUAL_ENV" ] && `which vagrant > /dev/null` && [ -e .vagrant ]; then
|
2017-02-07 22:19:43 +01:00
|
|
|
vcmd='/srv/zulip/tools/lint-all --pep8 --force $(cd /srv/zulip && git diff --cached --name-only --diff-filter=ACM) || true'
|
2016-08-17 22:03:54 +02:00
|
|
|
echo "Running lint-all using vagrant..."
|
|
|
|
vagrant ssh -c "$vcmd"
|
|
|
|
else
|
2017-02-07 22:19:43 +01:00
|
|
|
./tools/lint-all --pep8 --force $(git diff --cached --name-only --diff-filter=ACM) || true
|
2016-08-17 22:03:54 +02:00
|
|
|
fi
|
|
|
|
exit 0
|