diff --git a/bin/pre-commit b/bin/pre-commit new file mode 100755 index 0000000..f738ab2 --- /dev/null +++ b/bin/pre-commit @@ -0,0 +1,20 @@ +#!/usr/bin/env python +import git_lint + +def main(*args): + if git_lint.git_base is None: + sys.exit(_('A git repository was not found.')) + + pre_commit_config = { + 'staging': True, + 'base': True, + 'all': True + } + + config = git_lint.get_config(pre_commit_config, git_lint.git_base) + return git_lint.run_gitlint(pre_commit_config, config, []) + + +if __name__ == '__main__': + import sys + sys.exit(main(*sys.argv))