Skip to content

Commit

Permalink
Add default post-commit hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Nov 8, 2023
1 parent 6aea0be commit 3b0d240
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions bin/githooks/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Custom post-commit hook that runs the linter.

action() {
# just lint
if [ ! -d "${HBT_BASE}" ]; then
>&2 echo "HBT_BASE not setup, skip linting"
elif [ "${HBT_SKIP_POST_COMMIT}" != "1" ]; then
echo "post-commit linting ..."
bash "${HBT_BASE}/tests/run_linting"
echo
fi

# always end successfully
return "0"
}
action "$@"
2 changes: 1 addition & 1 deletion modules/columnflow

0 comments on commit 3b0d240

Please sign in to comment.