Skip to content

Commit

Permalink
Add pre-commit and pre-push hook
Browse files Browse the repository at this point in the history
  • Loading branch information
treiher committed Jun 22, 2022
1 parent 2fcd78b commit f458999
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ install_devel:
$(MAKE) -C .config/python-style install_devel
pip3 install -e ".[devel]"

install_git_hooks:
install -m 755 tools/pre-{commit,push} .git/hooks/

upgrade_devel:
tools/upgrade_dependencies.py

Expand Down
1 change: 1 addition & 0 deletions doc/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Make targets for common development tasks are:
- `format` Perform automatic code formatting on Python code
- `install_devel` Install project in editable mode
- `upgrade_devel` Upgrade all development dependencies (note: `install_devel` must be executed before changes in `setup.py` take effect)
- `install_git_hooks` Install git hooks for automatic checks before creating and pushing commits

Additional tools can be found in `tools/`.

Expand Down
3 changes: 3 additions & 0 deletions tools/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

make check_black check_isort
3 changes: 3 additions & 0 deletions tools/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

make check

0 comments on commit f458999

Please sign in to comment.