Closed victoria-miltcheva closed 1 year ago
I need to do some additional testing on Monday to see if this will be logged each time a scan is run when a plugin is disabled: https://github.com/IBM/detect-secrets/blob/improve-logging-visibility/detect_secrets/plugins/common/initialize.py#L140-L143
If so, that would be really noisy and should only show up in verbose mode...
Note about https://github.com/IBM/detect-secrets/pull/120/commits/ef5796829cd57e0e69564cdbc89b4b80c97d03a1:
I noticed that when a --no-<insert-plugin-name>-scan
option is included in the scan arguments to initailize a new baseline file, a certain message always shows up.
For example if you have this in test.py
:
detect_secrets.main.main(
[
"scan",
"--update",
".secrets.baseline",
"--no-keyword-scan"
]
)
You will see the following log when running a scan to generate a new baseline file:
--keyword-exclude specified, but KeywordDetector not configured! Ignoring..
To prevent this from being logged in each scan, I changed its log level to debug: https://github.com/IBM/detect-secrets/pull/120/files#diff-7f359002f472ddc72105e7e538bae0ccbb3e0e6e7034d821c05b7c34fef0e52aR140
What does this PR do?
WARNING
instead ofERROR
. This way, warnings will be displayed back to the user by default, which helps with troubleshooting issues. They will no longer need to provide the--verbose
flag to be able to see warnings anymore.detect_secrets/core/secrets_collection.py
).secrets.baseline
fileHow to test
test.py
file in the rootdetect-secrets
directory:python test.py
to test which logs show up without the--verbose
option. Result:test.py
and uncomment lines 13-20 to test the--verbose
option. Result: