Skip to content

Support scanning multiple specified files on the command line #180

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

Closed
MVrachev opened this issue May 17, 2019 · 4 comments
Closed

Support scanning multiple specified files on the command line #180

MVrachev opened this issue May 17, 2019 · 4 comments
Labels
good first issue The issue can be tackled by someone who has little to no knowledge about the project.

Comments

@MVrachev
Copy link

MVrachev commented May 17, 2019

Hi, how can I scan multiple files?

I don't want to scan a whole folder I want to scan only a few specific files.
I want to achieve something like that: detect-secrets scan test.js test.yaml but right now when I run it I get:

image

@MVrachev MVrachev changed the title Scan multiple files [Question] Scan multiple files May 17, 2019
@dgzlopes
Copy link
Contributor

I think (from researching a little on the code out of curiosity) that it's only scanning the first argument (file or directory). Maybe this one is the 'offending' function:

def _add_initialize_baseline_argument(self):

As it's using '?' nargs that reads only one argument if possible [0]. I'm sure that @domanchi or @KevinHock can throw more light on this issue.

[0] https://docs.python.org/3/library/argparse.html#nargs

@domanchi
Copy link
Contributor

@dgzlopes++

That's accurate. Shouldn't be too hard to modify this such that it can scan multiple files with the command line invocation you suggested: https://github.com/Yelp/detect-secrets/blob/master/detect_secrets/core/baseline.py#L37

@domanchi domanchi added enhancement good first issue The issue can be tackled by someone who has little to no knowledge about the project. labels May 17, 2019
@domanchi domanchi changed the title [Question] Scan multiple files Support scanning multiple specified files on the command line May 17, 2019
@MVrachev
Copy link
Author

MVrachev commented May 17, 2019

I closed it by mistake.

@domanchi
Copy link
Contributor

Closing issue, as #188 has been merged.

killuazhu pushed a commit to killuazhu/detect-secrets that referenced this issue Oct 18, 2019
* Tighter GH detector

* Fix tox and address PR comments

* Address 3 of 4 PR comments

* Remove machine tests

* Comments addressed...can't figure out why one test is still failing

* Fixed tests

* Addressed last comment

* Addressed optional comment.
killuazhu pushed a commit to IBM/detect-secrets that referenced this issue May 28, 2020
* Tighter GH detector

* Fix tox and address PR comments

* Address 3 of 4 PR comments

* Remove machine tests

* Comments addressed...can't figure out why one test is still failing

* Fixed tests

* Addressed last comment

* Addressed optional comment.
killuazhu pushed a commit to IBM/detect-secrets that referenced this issue Jul 9, 2020
* Tighter GH detector

* Fix tox and address PR comments

* Address 3 of 4 PR comments

* Remove machine tests

* Comments addressed...can't figure out why one test is still failing

* Fixed tests

* Addressed last comment

* Addressed optional comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue The issue can be tackled by someone who has little to no knowledge about the project.
Projects
None yet
Development

No branches or pull requests

3 participants