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

Configure to only warn, for pre-commit hook config #854

Open
2 of 3 tasks
Architrixs opened this issue Jun 17, 2024 · 5 comments
Open
2 of 3 tasks

Configure to only warn, for pre-commit hook config #854

Architrixs opened this issue Jun 17, 2024 · 5 comments

Comments

@Architrixs
Copy link

  • I'm submitting a ...

    • bug report
    • feature request
    • Question
  • What is the current behavior?

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?
    I am using this with pre-commit, Is there a way i could configure this to Pass, with an exit code 0, with warnings about the detected secrets. I just need it to warn, may be print report, but still let it pass the hook.

  • Please tell us about your environment:

    • detect-secrets Version: v1.5.0
    • Python Version: 3.10.0
    • OS Version:
    • File type (if applicable):
  • Other information

@gpflaum
Copy link
Contributor

gpflaum commented Jun 17, 2024

@Architrixs Assuming you are running on Linux, you can ignore the exit code by adding || true to the command, like this:

git diff --staged --name-only -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline || true

@gpflaum
Copy link
Contributor

gpflaum commented Jun 17, 2024

Sorry, I missed that you are using pre-commit. I don't know how to do it in that framework.

@Architrixs
Copy link
Author

so, could this be a potential feature?

Sorry, I missed that you are using pre-commit. I don't know how to do it in that framework.

@lorenzodb1
Copy link
Member

Could this help?

@Architrixs
Copy link
Author

Could this help?

Thanks, I'll check it out.

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