File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed
Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 88build
99dist
1010* .egg-info
11+ * .iml
Original file line number Diff line number Diff line change 1+
2+ import argparse
3+
4+
5+ def install ():
6+ """Install the pre-commit hook."""
7+ raise NotImplementedError
8+
9+
10+ def uninstall ():
11+ """Uninstall the pre-commit hook."""
12+ raise NotImplementedError
13+
14+
15+ def run_hooks (arguments ):
16+ """Actually run the hooks."""
17+ raise NotImplementedError
18+
19+
20+ def run (argv ):
21+ parser = argparse .ArgumentParser ()
22+
23+ group = parser .add_mutually_exclusive_group (required = False )
24+ group .add_argument (
25+ '-i' , '--install' ,
26+ action = 'store_true' ,
27+ help = 'Install the pre-commit script.' ,
28+ )
29+ group .add_argument (
30+ '-u' , '--uninstall' ,
31+ action = 'store_true' ,
32+ help = 'Uninstall the pre-commit script.' ,
33+ )
34+
35+ args = parser .parse_args (argv )
36+
37+ if args .install :
38+ install ()
39+ elif args .uninstall :
40+ uninstall ()
41+ else :
42+ run_hooks (args )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ if __name__ == '__main__' :
4+ import sys
5+
6+ from pre_commit .run import run
7+
8+ sys .exit (run (sys .argv [1 :]))
Original file line number Diff line number Diff line change 99 'argparse' ,
1010 'simplejson' ,
1111 ],
12+ scripts = [
13+ 'scripts/pre-commit.py' ,
14+ ],
1215)
You can’t perform that action at this time.
0 commit comments