Implement global exclude

This commit is contained in:
Anthony Sottile
2017-09-09 22:02:01 -07:00
parent 6af60158ec
commit ecdc22ce80
3 changed files with 17 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ CONFIG_SCHEMA = schema.Map(
'Config', None,
schema.RequiredRecurse('repos', schema.Array(CONFIG_REPO_DICT)),
schema.Optional('exclude', schema.check_regex, '^$'),
schema.Optional('fail_fast', schema.check_bool, False),
)

View File

@@ -183,6 +183,7 @@ def _run_hooks(config, repo_hooks, args, environ):
skips = _get_skips(environ)
cols = _compute_cols([hook for _, hook in repo_hooks], args.verbose)
filenames = _all_filenames(args)
filenames = _filter_by_include_exclude(filenames, '', config['exclude'])
retval = 0
for repo, hook in repo_hooks:
retval |= _run_single_hook(filenames, hook, repo, args, skips, cols)