mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-04 14:29:14 -05:00
Address review comments and test failures
This commit is contained in:
@@ -257,17 +257,20 @@ def run(config_file, store, args, environ=os.environ):
|
||||
for repo in repositories(config, store):
|
||||
for _, hook in repo.hooks:
|
||||
if (
|
||||
(not args.hook or hook['id'] == args.hook or (
|
||||
hook['alias'] and hook['alias'] == args.hook
|
||||
)) and
|
||||
(not hook['stages'] or args.hook_stage in hook['stages'])
|
||||
(
|
||||
not args.hook or
|
||||
hook['id'] == args.hook or
|
||||
hook['alias'] == 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 or alias `{}`'.format(args.hook),
|
||||
)
|
||||
output.write_line('No hook with id `{}`'.format(args.hook))
|
||||
return 1
|
||||
|
||||
for repo in {repo for repo, _ in repo_hooks}:
|
||||
|
||||
Reference in New Issue
Block a user