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

Custom Filters cannot be passed in from the command line #715

Open
1 of 2 tasks
a-weiss-programmer opened this issue Oct 23, 2023 · 0 comments
Open
1 of 2 tasks

Custom Filters cannot be passed in from the command line #715

a-weiss-programmer opened this issue Oct 23, 2023 · 0 comments
Labels
bug The issue describes a malfunctioning aspect of the project. help wanted Indicates that we would like someone that’s not a maintainer to work on the issue. triaged The issue has been reviewed but has not been solved yet.

Comments

@a-weiss-programmer
Copy link

  • I'm submitting a ...

    • bug report
    • feature request
  • What is the current behavior?
    Adding a custom filter by file when doing a command line scan is not working. When trying to pass a custom filter as described in the document, a command line usage error comes back saying "detect-secrets scan: error: argument -f/--filter: Did not specify function name for imported file."

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

  1. Install detect-secrets
  2. Create a custom_filter.py script with the given filter in the documentation
  3. Invoke the command below the example script provided in the filter documentation
    9ozQvsEVtE
  • What is the expected behavior?
    The expected behavior is that the filter would be picked up properly. This functionality works when invoking detect secrets from a separate python program.

  • What is the motivation / use case for changing the behavior?
    Allows for proper usage of the command line behavior provided

  • Please tell us about your environment:

    • detect-secrets Version: 1.4.30
    • Python Version: 3.11.5
    • OS Version: Ubuntu 22.04.3 LTS (Windows Subsystem for Linux)
    • File type (if applicable):
  • Other information
    This is most likely an issue with urllib parsing of the file in the filters usage file, as urlparse returns a ParseResult where the netloc property is populated with the filepath instead of the path property, since the scheme is file based.

WindowsTerminal_eZtkAdZvR6

@lorenzodb1 lorenzodb1 added the pending The issue still needs to be reviewed by one of the maintainers. label Nov 17, 2023
@lorenzodb1 lorenzodb1 added help wanted Indicates that we would like someone that’s not a maintainer to work on the issue. triaged The issue has been reviewed but has not been solved yet. bug The issue describes a malfunctioning aspect of the project. and removed pending The issue still needs to be reviewed by one of the maintainers. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue describes a malfunctioning aspect of the project. help wanted Indicates that we would like someone that’s not a maintainer to work on the issue. triaged The issue has been reviewed but has not been solved yet.
Projects
None yet
Development

No branches or pull requests

2 participants