mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
fix: regex lists to regex tuples
This commit is contained in:
parent
597726f8e1
commit
51ab763824
1 changed files with 2 additions and 2 deletions
|
|
@ -144,7 +144,7 @@ class OptionalSensibleRegexAtHook(cfgv.OptionalNoDefault):
|
||||||
f"regex, not a glob -- matching '/*' probably isn't what you "
|
f"regex, not a glob -- matching '/*' probably isn't what you "
|
||||||
f'want here',
|
f'want here',
|
||||||
)
|
)
|
||||||
for fwd_slash_re in [r'[\\/]', r'[\/]', r'[/\\]']:
|
for fwd_slash_re in (r'[\\/]', r'[\/]', r'[/\\]'):
|
||||||
if fwd_slash_re in dct.get(self.key, ''):
|
if fwd_slash_re in dct.get(self.key, ''):
|
||||||
logger.warning(
|
logger.warning(
|
||||||
fr'pre-commit normalizes slashes in the {self.key!r} '
|
fr'pre-commit normalizes slashes in the {self.key!r} '
|
||||||
|
|
@ -162,7 +162,7 @@ class OptionalSensibleRegexAtTop(cfgv.OptionalNoDefault):
|
||||||
f'The top-level {self.key!r} field is a regex, not a glob -- '
|
f'The top-level {self.key!r} field is a regex, not a glob -- '
|
||||||
f"matching '/*' probably isn't what you want here",
|
f"matching '/*' probably isn't what you want here",
|
||||||
)
|
)
|
||||||
for fwd_slash_re in [r'[\\/]', r'[\/]', r'[/\\]']:
|
for fwd_slash_re in (r'[\\/]', r'[\/]', r'[/\\]'):
|
||||||
if fwd_slash_re in dct.get(self.key, ''):
|
if fwd_slash_re in dct.get(self.key, ''):
|
||||||
logger.warning(
|
logger.warning(
|
||||||
fr'pre-commit normalizes the slashes in the top-level '
|
fr'pre-commit normalizes the slashes in the top-level '
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue