mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
Use parens instead of different logic pattern.
This commit is contained in:
@@ -254,13 +254,11 @@ def run(runner, store, args, environ=os.environ):
|
||||
repo_hooks = []
|
||||
for repo in repositories(runner.config, store):
|
||||
for _, hook in repo.hooks:
|
||||
if args.hook:
|
||||
if args.hook == hook['id']:
|
||||
repo_hooks.append((repo, hook))
|
||||
break
|
||||
else:
|
||||
if not hook['stages'] or args.hook_stage in hook['stages']:
|
||||
repo_hooks.append((repo, hook))
|
||||
if (
|
||||
(not args.hook or hook['id'] == args.hook) and
|
||||
(not hook['stages'] or args.hook_stage in hook['stages'])
|
||||
):
|
||||
repo_hooks.append((repo, hook))
|
||||
|
||||
if args.hook and not repo_hooks:
|
||||
output.write_line('No hook with id `{}`'.format(args.hook))
|
||||
|
||||
Reference in New Issue
Block a user