diff --git a/README.md b/README.md index 517d3282..4da5b889 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,20 @@ environment like so: pipenv shell ``` -and then commands like `pycodestyle` and `pytest` can be run like normal. \ No newline at end of file +and then commands like `pycodestyle` and `pytest` can be run like normal. + +Additionally, we use [Travis CI](https://travis-ci.org/ubclaunchpad/rocket2.0) as +a CI system. To run the same checks locally, we provide `scripts/build_check.sh`; +this can be run with: + +```bash +./scripts/build_check.sh +``` + +You can also install it as a +[pre-commit hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) for git: + +```bash +cd scripts/ +make install +``` diff --git a/scripts/Makefile b/scripts/Makefile new file mode 100644 index 00000000..f5d676b9 --- /dev/null +++ b/scripts/Makefile @@ -0,0 +1,4 @@ +.PHONY: install +install: + cp build_check.sh ../.git/hooks/pre-commit + cp update.sh ../.git/hooks/post-merge diff --git a/scripts/build_check.sh b/scripts/build_check.sh new file mode 100755 index 00000000..d85e6d15 --- /dev/null +++ b/scripts/build_check.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euxo pipefail +pipenv run pycodestyle . +pipenv run pydocstyle . +mdl . +pipenv run pytest tests/ diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 00000000..53844d61 --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +set -euxo pipefail +pipenv sync --dev