Skip to content

Commit

Permalink
Adjust filter regex usage per #245 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Zhou committed Oct 10, 2019
1 parent b402f51 commit ece342b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detect_secrets/plugins/common/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def is_potential_uuid(secret, *args):
# will find us more false-positives than if we just tried validate
# the input string as a UUID (for example, if the string has a prefix
# or suffix).
return len(_UUID_REGEX.findall(secret)) > 0
return bool(_UUID_REGEX.search(secret))


DEFAULT_FALSE_POSITIVE_HEURISTICS = [
Expand Down Expand Up @@ -128,7 +128,7 @@ def is_likely_id_string(secret, line):
return False

secret_index = line.index(secret)
return _ID_DETECTOR_REGEX.findall(line, pos=0, endpos=secret_index)
return bool(_ID_DETECTOR_REGEX.search(line, pos=0, endpos=secret_index))


DEFAULT_FALSE_POSITIVE_WITH_LINE_CONTEXT_HEURISTICS = [
Expand Down

0 comments on commit ece342b

Please sign in to comment.