Use parens instead of different logic pattern.

This commit is contained in:
Matt Layman
2018-07-19 23:27:29 -04:00
parent a8b298799c
commit fd1bc21d8e

View File

@@ -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))