Skip to content

Commit

Permalink
Merge pull request #35 from ubclaunchpad/rwblickhan/#15-create-precom…
Browse files Browse the repository at this point in the history
…mit-hook

Add pre-commit/post-merge hooks
  • Loading branch information
rwblickhan committed Oct 11, 2018
2 parents 64edf35 + 71224fc commit 42ad5c9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,20 @@ environment like so:
pipenv shell
```

and then commands like `pycodestyle` and `pytest` can be run like normal.
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
```
4 changes: 4 additions & 0 deletions scripts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: install
install:
cp build_check.sh ../.git/hooks/pre-commit
cp update.sh ../.git/hooks/post-merge
6 changes: 6 additions & 0 deletions scripts/build_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euxo pipefail
pipenv run pycodestyle .
pipenv run pydocstyle .
mdl .
pipenv run pytest tests/
3 changes: 3 additions & 0 deletions scripts/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euxo pipefail
pipenv sync --dev

0 comments on commit 42ad5c9

Please sign in to comment.