Adding upstream version 2.16.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
d3b459fcc0
commit
ea92097ba5
34 changed files with 301 additions and 126 deletions
|
@ -70,6 +70,7 @@ MANIFEST_HOOK_DICT = cfgv.Map(
|
|||
),
|
||||
cfgv.Optional('args', cfgv.check_array(cfgv.check_string), []),
|
||||
cfgv.Optional('always_run', cfgv.check_bool, False),
|
||||
cfgv.Optional('fail_fast', cfgv.check_bool, False),
|
||||
cfgv.Optional('pass_filenames', cfgv.check_bool, True),
|
||||
cfgv.Optional('description', cfgv.check_string, ''),
|
||||
cfgv.Optional('language_version', cfgv.check_string, C.DEFAULT),
|
||||
|
@ -143,6 +144,18 @@ class OptionalSensibleRegexAtHook(cfgv.OptionalNoDefault):
|
|||
f"regex, not a glob -- matching '/*' probably isn't what you "
|
||||
f'want here',
|
||||
)
|
||||
if r'[\/]' in dct.get(self.key, ''):
|
||||
logger.warning(
|
||||
fr'pre-commit normalizes slashes in the {self.key!r} field '
|
||||
fr'in hook {dct.get("id")!r} to forward slashes, so you '
|
||||
fr'can use / instead of [\/]',
|
||||
)
|
||||
if r'[/\\]' in dct.get(self.key, ''):
|
||||
logger.warning(
|
||||
fr'pre-commit normalizes slashes in the {self.key!r} field '
|
||||
fr'in hook {dct.get("id")!r} to forward slashes, so you '
|
||||
fr'can use / instead of [/\\]',
|
||||
)
|
||||
|
||||
|
||||
class OptionalSensibleRegexAtTop(cfgv.OptionalNoDefault):
|
||||
|
@ -154,6 +167,18 @@ class OptionalSensibleRegexAtTop(cfgv.OptionalNoDefault):
|
|||
f'The top-level {self.key!r} field is a regex, not a glob -- '
|
||||
f"matching '/*' probably isn't what you want here",
|
||||
)
|
||||
if r'[\/]' in dct.get(self.key, ''):
|
||||
logger.warning(
|
||||
fr'pre-commit normalizes the slashes in the top-level '
|
||||
fr'{self.key!r} field to forward slashes, so you can use / '
|
||||
fr'instead of [\/]',
|
||||
)
|
||||
if r'[/\\]' in dct.get(self.key, ''):
|
||||
logger.warning(
|
||||
fr'pre-commit normalizes the slashes in the top-level '
|
||||
fr'{self.key!r} field to forward slashes, so you can use / '
|
||||
fr'instead of [/\\]',
|
||||
)
|
||||
|
||||
|
||||
class MigrateShaToRev:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue