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

Show helpful error message when plugin not found due to scanning 'new' baseline #269

Closed
KevinHock opened this issue Nov 11, 2019 · 2 comments

Comments

@KevinHock
Copy link
Collaborator

There is a bad error message that happens when someone has a pre-commit detect-secrets version, and then uses a baseline generated with a newer version of detect-secrets. B/c the 'older' d-s does not have the new plugins, it just fails with an e.g.

detect_secrets/plugins/common/initialize.py", line 145, in from_plugin_classname
    klass = globals()[plugin_classname]
KeyError: 'JwtTokenDetector'

We can easily catch this, and give a useful error message pretty easily.

Multiple people have ran into this.

KevinHock added a commit that referenced this issue Nov 12, 2019
Having this wrong makes people run into #269
@PritamSangani
Copy link

Hey this issue has cropped up again with the v0.13.1 release. The README still has the v0.13.0 rev number and so when running the precommit hook it is failing:

detect_secrets/plugins/common/initialize.py", line 166, in from_plugin_classname
    klass = import_plugins()[plugin_classname]
KeyError: 'CloudantDetector'

KevinHock added a commit that referenced this issue Apr 2, 2020
The latest version is `v0.13.1`, we forgot to update it in a3e7998
KevinHock added a commit that referenced this issue Apr 4, 2020
This fixes issue #269.
Previously we showed an unhelpful stack trace.
KevinHock added a commit that referenced this issue Apr 4, 2020
This fixes issue #269.
Previously we showed an unhelpful stack trace.
KevinHock added a commit that referenced this issue Apr 4, 2020
This fixes issue #269.
Previously we showed an unhelpful stack trace.
@KevinHock
Copy link
Collaborator Author

This was indeed fixed in the above referenced commit, all that is left to do is bump the version.

Thanks @PritamSangani for bringing this up!

killuazhu pushed a commit to IBM/detect-secrets that referenced this issue May 28, 2020
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

No branches or pull requests

3 participants