-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add per line exclude regex via --exclude-line #127
Conversation
This reverts commit 15a6e6a.
Change baseline format to replace `exclude_regex` with ``` "exclude":{ "files": "foo", "lines": "bar" } ``` Pass `exclude_lines_re` to all plugins in `from_plugin_classname`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix and ship!
When `scan_diff`, used by `detect-secrets-server` calls `_extract_secrets_from_patch` it uses `plugin.analyze_string`, and we were previously checking whitelist regexes in plugins' `analyze` method. :snake: Change all `_re` suffixes to `_regex` Add a newline in plugins, particularly between class def and secret_type attribute
(took feedback into account and fixed a 🐛 that detect-secrets-server triggers 👍 ) |
@@ -39,7 +39,9 @@ class HighEntropyStringsPlugin(BasePlugin): | |||
|
|||
__metaclass__ = ABCMeta | |||
|
|||
def __init__(self, charset, limit, exclude_lines_re, *args): | |||
secret_type = 'High Entropy String' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary -- after all, there shouldn't be a secret_type
, seeing that this class cannot (and should not) be constructed directly.
This also checks for it: https://github.com/Yelp/detect-secrets/blob/master/detect_secrets/plugins/base.py#L16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah fair. Probably cause we didn't do a super
call.
You can drop the issue. Probably easier this way, than creating a mock base class.
So this reverts 15a6e6a in favor of a line exclude arg for all plugins. If at a later date we would like a regex specifically for e.g.
KeywordDetector
, then we can add that feature then.💥 This removes the
--exclude
CLI arg🎉 Replace
--exclude with
--exclude-files
and--exclude-lines