Closed pierrelalanne closed 8 hours ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.97%. Comparing base (
b96eb05
) to head (71ec8ea
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The Fix
If no default value is defined for the option
with-incident-details
, the behavior of ggshield can be misleading and actually bugged. Indeed, each command or subcommand uses the decorator "add_secret_scan_common_options" to collect values of several command options. This lets the user place the option --with-incident-details at several level in the command line.If they do so, the command or subcommand that does not have the flag will set the value to False which can prevent the option from working correctly. For instance:
ggshield secret scan --with-incident-details path dummy.py
=> The option is set to False in the end because the path subcommand does not have the option defined.ggshield secret scan path --with-incident-details dummy.py
=> The optiton is set to True, because defined in the path subcommand.We make the option default to None. This does not override the value defined earlier in the command line.
Remarks