mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-14 13:00:10 -06:00
fix the default value for types_or
This commit is contained in:
@@ -61,7 +61,7 @@ MANIFEST_HOOK_DICT = cfgv.Map(
|
||||
cfgv.Optional('files', check_string_regex, ''),
|
||||
cfgv.Optional('exclude', check_string_regex, '^$'),
|
||||
cfgv.Optional('types', cfgv.check_array(check_type_tag), ['file']),
|
||||
cfgv.Optional('types_or', cfgv.check_array(check_type_tag), ['file']),
|
||||
cfgv.Optional('types_or', cfgv.check_array(check_type_tag), []),
|
||||
cfgv.Optional('exclude_types', cfgv.check_array(check_type_tag), []),
|
||||
|
||||
cfgv.Optional(
|
||||
|
||||
@@ -92,7 +92,11 @@ class Classifier:
|
||||
ret = []
|
||||
for filename in names:
|
||||
tags = self._types_for_file(filename)
|
||||
if tags >= types and tags & types_or and not tags & exclude_types:
|
||||
if (
|
||||
tags >= types and
|
||||
(not types_or or tags & types_or) and
|
||||
not tags & exclude_types
|
||||
):
|
||||
ret.append(filename)
|
||||
return ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user