Commit 71ec8ea
committed
fix(with_incident_details): # We add a default value None to the click option to fix the behavior of the option
If no default value is defined, 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.1 parent b96eb05 commit 71ec8ea
File tree
2 files changed
+50
-0
lines changed- changelog.d
- ggshield/cmd/secret/scan
2 files changed
+50
-0
lines changedLines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
| |||
0 commit comments