This repository has been archived on 2021-12-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
jos/.hooks/pre-commit

14 lines
323 B
Bash
Executable file

#!/usr/bin/env bash
# This hook lints the code, and if we're on develop or master, also forces the tests to pass.
branch=`git rev-parse --abbrev-ref HEAD`
# Just lint the code before committing
make lint
# TODO should we add release branches here as well?
if [[ "$branch" =~ ^master|develop$ ]]; then
make test
fi