|
21 | 21 | from pre_commit.error_handler import error_handler |
22 | 22 | from pre_commit.logging_handler import add_logging_handler |
23 | 23 | from pre_commit.runner import Runner |
| 24 | +from pre_commit.store import Store |
24 | 25 |
|
25 | 26 |
|
26 | 27 | logger = logging.getLogger('pre_commit') |
@@ -230,32 +231,34 @@ def main(argv=None): |
230 | 231 | with error_handler(): |
231 | 232 | add_logging_handler(args.color) |
232 | 233 | runner = Runner.create(args.config) |
| 234 | + store = Store() |
233 | 235 | git.check_for_cygwin_mismatch() |
234 | 236 |
|
235 | 237 | if args.command == 'install': |
236 | 238 | return install( |
237 | | - runner, overwrite=args.overwrite, hooks=args.install_hooks, |
| 239 | + runner, store, |
| 240 | + overwrite=args.overwrite, hooks=args.install_hooks, |
238 | 241 | hook_type=args.hook_type, |
239 | 242 | skip_on_missing_conf=args.allow_missing_config, |
240 | 243 | ) |
241 | 244 | elif args.command == 'install-hooks': |
242 | | - return install_hooks(runner) |
| 245 | + return install_hooks(runner, store) |
243 | 246 | elif args.command == 'uninstall': |
244 | 247 | return uninstall(runner, hook_type=args.hook_type) |
245 | 248 | elif args.command == 'clean': |
246 | | - return clean(runner.store) |
| 249 | + return clean(store) |
247 | 250 | elif args.command == 'autoupdate': |
248 | 251 | if args.tags_only: |
249 | 252 | logger.warning('--tags-only is the default') |
250 | 253 | return autoupdate( |
251 | | - runner, runner.store, |
| 254 | + runner, store, |
252 | 255 | tags_only=not args.bleeding_edge, |
253 | 256 | repos=args.repos, |
254 | 257 | ) |
255 | 258 | elif args.command == 'migrate-config': |
256 | 259 | return migrate_config(runner) |
257 | 260 | elif args.command == 'run': |
258 | | - return run(runner, args) |
| 261 | + return run(runner, store, args) |
259 | 262 | elif args.command == 'sample-config': |
260 | 263 | return sample_config() |
261 | 264 | elif args.command == 'try-repo': |
|
0 commit comments