Various small improvements#293
Merged
Merged
Conversation
Hopefully this avoids needing fixes like ca266b1 Note: I excluded the script from `.pre-commit-config.yaml` to use f-strings We can remove the exclusion when we drop python3.5 support
This fixes issue #269. Previously we showed an unhelpful stack trace.
Missed a few in 5d0d461 Ran `grep -rnw --include=*.py -e 'future' | grep -v three_six | grep -v .tox` this time.
d5de840 to
5ca1d7e
Compare
This fixes issue #244. Only check the line for allowlist regexes or --exclude-lines if a secret was found.
OiCMudkips
approved these changes
Apr 16, 2020
| def _is_excluded_line(self, line): | ||
| return ( | ||
| any( | ||
| allowlist_regex.search(line) |
Contributor
There was a problem hiding this comment.
Is there a test for this? I thought you needed to wrap the X for X in Y syntax in an array, but I might be wrong.
Collaborator
Author
There was a problem hiding this comment.
There is a test 👍
detect-secrets/tests/plugins/high_entropy_strings_test.py
Lines 97 to 133 in ca266b1
>>> san = [True, False, True]
>>> fran = {False}
>>> any(boo for boo in san)
True
>>> any(boo for boo in fran)
False
killuazhu
pushed a commit
to IBM/detect-secrets
that referenced
this pull request
May 28, 2020
killuazhu
pushed a commit
to IBM/detect-secrets
that referenced
this pull request
Jul 9, 2020
killuazhu
pushed a commit
to IBM/detect-secrets
that referenced
this pull request
Sep 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.