2016-09-26 23:03:08 +00:00
|
|
|
#!/usr/bin/env python
|
2016-09-29 19:38:23 +00:00
|
|
|
from git_lint import load_config, run_linters, git_base
|
2016-09-26 23:03:08 +00:00
|
|
|
|
|
|
|
def main(*args):
|
2016-09-29 19:38:23 +00:00
|
|
|
if git_base is None:
|
2016-09-26 23:03:08 +00:00
|
|
|
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-26 23:03:08 +00:00
|
|
|
}
|
|
|
|
|
2016-09-29 19:38:23 +00:00
|
|
|
config = load_config(pre_commit_config, git_base)
|
|
|
|
return run_linters(pre_commit_config, config, [])
|
2016-09-26 23:03:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys
|
|
|
|
sys.exit(main(*sys.argv))
|