From 4a6db9047e0fe19788703318ecf1bdf70d7923c0 Mon Sep 17 00:00:00 2001 From: Greg Pflaum Date: Mon, 23 Nov 2020 23:57:27 -0500 Subject: [PATCH] fix hang with very long lines --- detect_secrets/plugins/keyword.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect_secrets/plugins/keyword.py b/detect_secrets/plugins/keyword.py index 4531f9473..c16474adb 100644 --- a/detect_secrets/plugins/keyword.py +++ b/detect_secrets/plugins/keyword.py @@ -146,7 +146,7 @@ DENYLIST_REGEX = r'|'.join(DENYLIST) # Non-greedy match OPTIONAL_WHITESPACE = r'\s*?' -OPTIONAL_NON_WHITESPACE = r'[^\s]*?' +OPTIONAL_NON_WHITESPACE = r'[^\s]{0,50}?' QUOTE = r'[\'"]' SECRET = r'[^\s]+' SQUARE_BRACKETS = r'(\[\])'