Skip to content
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

Multiple filters support and secret filter by regex #391

Merged
merged 6 commits into from
Feb 3, 2021
Merged

Multiple filters support and secret filter by regex #391

merged 6 commits into from
Feb 3, 2021

Conversation

pablosnt
Copy link
Contributor

This Pull Request includes the following features:

  • Support for multiple filters: it allows multiple occurrences of the CLI options --exclude-lines and --exclude-files. The user can apply multiple regexes to filter the output of detect-secrets.
  • New secret filter by regex: it could be interesting to discard fake secrets of secrets that are external references to, for example, environmental variables.

The tests/filters/regex_filter_test.py has been updated to the multiple regexes support and includes the test_should_exclude_secret that tests the new secret filter.

@pablosnt pablosnt changed the title Feature/v1 multiple filters Multiple filters support and secret filter by regex Jan 12, 2021
@pablosnt
Copy link
Contributor Author

pablosnt commented Jan 29, 2021

Hello @domanchi, this pull request resolves the problem described in #403. This feature could improve the usability and the configuration of the detect-secrets tool, without any impact in its performance.

Moreover, the users still could use only one --exclude-files or --exlude-lines option to add multiple filters within a regex. With this pull request, detect-secrets adds more possibilities to the filters configuration, but the original one is still available.

Copy link
Contributor

@domanchi domanchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! A couple of things to add, before we can merge this:

@pablosnt
Copy link
Contributor Author

pablosnt commented Feb 1, 2021

Thank you for your detailed comment @domanchi , I think that everything is updated with these commits.

@domanchi
Copy link
Contributor

domanchi commented Feb 3, 2021

I have verified that all tests pass with this branch.

@domanchi domanchi merged commit a3165d1 into Yelp:pre-v1-launch Feb 3, 2021
jimmyhlee94 pushed a commit to jimmyhlee94/detect-secrets that referenced this pull request Aug 19, 2021
* Fix disable flags for pre-commit

Follow up of Yelp#379

* docstrings
jimmyhlee94 pushed a commit to jimmyhlee94/detect-secrets that referenced this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants