-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from lbiaggi/pre-commit-hook
Pre-commit hook
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# expected stages: commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push | ||
|
||
- id: check-doorstop-errors | ||
args: ["-W"] | ||
name: check for doorstop errors | ||
description: ensures the changes introduces no errors | ||
entry: doorstop | ||
language: python | ||
verbose: true | ||
pass_filenames: false | ||
stages: [commit, push, manual] | ||
|
||
- id: check-unreviewed-items | ||
name: ensure that all requirements are reviewed before being committed | ||
description: ensure that all documents/requirements are reviewed before being committed | ||
entry: git_hooks/check_unreviewed_requirements.sh | ||
language: script | ||
verbose: true | ||
pass_filenames: false | ||
stages: [merge-commit, manual] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
output="$(doorstop -W 2>&1 | grep 'unreviewed changes')" | ||
|
||
if [ -n "$output" ]; then | ||
echo "$output" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters