2020-12-14 20:12:57 +03:00
|
|
|
#!/bin/sh
|
2020-09-09 14:03:27 +03:00
|
|
|
|
2020-12-14 20:12:57 +03:00
|
|
|
set -e -f -u
|
2020-07-15 12:49:08 +03:00
|
|
|
|
2021-06-28 18:24:33 +03:00
|
|
|
# Show all temporary todos to the programmer but don't fail the commit
|
|
|
|
# if there are any, because the commit could be in a temporary branch.
|
2021-06-29 13:36:52 +03:00
|
|
|
git grep -e 'TODO.*!!' -- ':!HACKING.md' ':!scripts/hooks/pre-commit' | cat || :
|
2021-06-28 18:24:33 +03:00
|
|
|
|
2021-05-19 20:31:20 +03:00
|
|
|
if [ "$( git diff --cached --name-only -- 'client/*.js' )" ]
|
2020-12-14 20:12:57 +03:00
|
|
|
then
|
|
|
|
make js-lint js-test
|
2020-07-15 12:49:08 +03:00
|
|
|
fi
|
|
|
|
|
2021-05-19 20:31:20 +03:00
|
|
|
if [ "$( git diff --cached --name-only -- 'client2/*.js' 'client2/*.ts' 'client2/*.tsx' )" ]
|
2021-01-28 14:02:38 +03:00
|
|
|
then
|
|
|
|
make js-beta-lint js-beta-test
|
|
|
|
fi
|
|
|
|
|
2021-05-19 20:31:20 +03:00
|
|
|
if [ "$( git diff --cached --name-only -- '*.go' '*.mod' '*.sh' 'Makefile' )" ]
|
2020-12-14 20:12:57 +03:00
|
|
|
then
|
2021-04-08 20:42:04 +03:00
|
|
|
make go-os-check go-lint go-test
|
2020-12-14 20:12:57 +03:00
|
|
|
fi
|
2021-01-14 13:48:52 +03:00
|
|
|
|
2021-05-19 20:31:20 +03:00
|
|
|
if [ "$( git diff --cached --name-only -- '*.md' '*.yaml' '*.yml' )" ]
|
|
|
|
then
|
|
|
|
make txt-lint
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$( git diff --cached --name-only -- './openapi/openapi.yaml' )" ]
|
2021-01-14 13:48:52 +03:00
|
|
|
then
|
|
|
|
make openapi-lint
|
|
|
|
fi
|