Skip to content

Commit 6f90c8e

Browse files
authored
Merge pull request #1003 from GitGuardian/plalanne/-/fix-with-incident-details-option
Fix with-incident-details option
2 parents b96eb05 + 71ec8ea commit 6f90c8e

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
-->
6+
7+
<!--
8+
### Removed
9+
10+
- A bullet item for the Removed category.
11+
12+
-->
13+
<!--
14+
### Added
15+
16+
- A bullet item for the Added category.
17+
18+
-->
19+
<!--
20+
### Changed
21+
22+
- A bullet item for the Changed category.
23+
24+
-->
25+
<!--
26+
### Deprecated
27+
28+
- A bullet item for the Deprecated category.
29+
30+
-->
31+
32+
### Fixed
33+
34+
- We add a default value None to the click option `with-incident-details` to fix the behavior of the option.
35+
<!--
36+
37+
### Security
38+
39+
- A bullet item for the Security category.
40+
41+
-->

ggshield/cmd/secret/scan/secret_scan_common_options.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ def _exclude_callback(
9595
_ignore_known_secrets_option = click.option(
9696
"--ignore-known-secrets",
9797
is_flag=True,
98+
# The default value **must** be set to None.
99+
# Each command or subcommand calls create_config_callback to gather option values.
100+
# If the option is placed early in the command line, the value may be overridden
101+
# later on with False if no default is defined.
98102
default=None,
99103
help="Ignore secrets already known by GitGuardian dashboard.",
100104
callback=create_config_callback("secret", "ignore_known_secrets"),
@@ -124,6 +128,11 @@ def _banlist_detectors_callback(
124128
_with_incident_details_option = click.option(
125129
"--with-incident-details",
126130
is_flag=True,
131+
# The default value **must** be set to None.
132+
# Each command or subcommand calls create_config_callback to gather option values.
133+
# If the option is placed early in the command line, the value may be overridden
134+
# later on with False if no default is defined.
135+
default=None,
127136
help="Display full details about the dashboard incident if one is found (JSON and SARIF formats only).",
128137
callback=create_config_callback("secret", "with_incident_details"),
129138
)

0 commit comments

Comments
 (0)