From b5088ceca6f51e46ca9406c8337602f2ca58c796 Mon Sep 17 00:00:00 2001 From: Tony Rintala Date: Sun, 5 Dec 2021 01:35:43 +0200 Subject: [PATCH] fix: regex lists to regex tuples --- pre_commit/clientlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_commit/clientlib.py b/pre_commit/clientlib.py index a224cc931..b8f236893 100644 --- a/pre_commit/clientlib.py +++ b/pre_commit/clientlib.py @@ -144,7 +144,7 @@ def check(self, dct: Dict[str, Any]) -> None: f"regex, not a glob -- matching '/*' probably isn't what you " 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, ''): logger.warning( fr'pre-commit normalizes slashes in the {self.key!r} ' @@ -162,7 +162,7 @@ def check(self, dct: Dict[str, Any]) -> None: f'The top-level {self.key!r} field is a regex, not a glob -- ' 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, ''): logger.warning( fr'pre-commit normalizes the slashes in the top-level '