Skip to content

Commit

Permalink
Fix regex from greedy to lazy
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel González Lopes <danielgonzalezlopes@gmail.com>
  • Loading branch information
dgzlopes committed May 10, 2019
1 parent 66fad8d commit 3117bcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detect_secrets/plugins/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
WHITELIST_REGEXES = [
re.compile(r)
for r in [
r'[ \t]+{} *pragma: ?whitelist[ -]secret.*{}[ \t]*$'.format(start, end)
r'[ \t]+{} *pragma: ?whitelist[ -]secret.*?{}[ \t]*$'.format(start, end)
for start, end in (
('#', ''), # e.g. python or yaml
('//', ''), # e.g. golang
Expand Down

0 comments on commit 3117bcd

Please sign in to comment.