git-linter/bin/pre-commit

20 lines
438 B
Plaintext
Raw Normal View History

#!/usr/bin/env python
2016-09-29 19:38:23 +00:00
from git_lint import load_config, run_linters, git_base
def main(*args):
2016-09-29 19:38:23 +00:00
if git_base is None:
sys.exit(_('A git repository was not found.'))
pre_commit_config = {
'staging': True,
2016-09-29 19:38:23 +00:00
'base': True
}
2016-09-29 19:38:23 +00:00
config = load_config(pre_commit_config, git_base)
return run_linters(pre_commit_config, config, [])
if __name__ == '__main__':
import sys
sys.exit(main(*sys.argv))