Skip to content

Commit 7a4496d

Browse files
Explcitly set default values for all click options
Reference: #4572 Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 03b8456 commit 7a4496d

26 files changed

+76
-13
lines changed

etc/scripts/fetch_thirdparty.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
metavar="REQUIREMENT-FILE",
3131
multiple=True,
3232
required=False,
33+
default=None,
3334
help="Path to pip requirements file(s) listing thirdparty packages.",
3435
)
3536
@click.option(
@@ -39,6 +40,7 @@
3940
type=str,
4041
metavar="SPECIFIER",
4142
multiple=True,
43+
default=None,
4244
required=False,
4345
help="Thirdparty package name==version specification(s) as in django==1.2.3. "
4446
"With --latest-version a plain package name is also acceptable.",
@@ -64,12 +66,14 @@
6466
"-w",
6567
"--wheels",
6668
is_flag=True,
69+
default=False,
6770
help="Download wheels.",
6871
)
6972
@click.option(
7073
"-s",
7174
"--sdists",
7275
is_flag=True,
76+
default=False,
7377
help="Download source sdists tarballs.",
7478
)
7579
@click.option(
@@ -107,6 +111,7 @@
107111
@click.option(
108112
"--use-cached-index",
109113
is_flag=True,
114+
default=False,
110115
help="Use on disk cached PyPI indexes list of packages and versions and "
111116
"do not refetch if present.",
112117
)

etc/scripts/licenses/license-csv/scancode_debug_license_csv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class LicenseCsvOutput(OutputPlugin):
4545
options = [
4646
PluggableCommandLineOption(('--license-csv',),
4747
type=FileOptionType(mode='w', encoding='utf-8', lazy=True),
48+
default=None,
4849
metavar='FILE',
4950
help='Write license scan debug output as CSV to FILE.',
5051
help_group=OUTPUT_GROUP,

src/cluecode/plugin_copyright.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class CopyrightScanner(ScanPlugin):
3333

3434
options = [
3535
PluggableCommandLineOption(('-c', '--copyright',),
36-
is_flag=True, default=False,
36+
is_flag=True,
37+
default=False,
3738
help='Scan <input> for copyrights.',
3839
help_group=SCAN_GROUP,
3940
sort_order=50),

src/cluecode/plugin_email.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ class EmailScanner(ScanPlugin):
3030

3131
options = [
3232
PluggableCommandLineOption(('-e', '--email',),
33-
is_flag=True, default=False,
33+
is_flag=True,
34+
default=False,
3435
help='Scan <input> for emails.',
3536
help_group=OTHER_SCAN_GROUP),
3637

3738
PluggableCommandLineOption(('--max-email',),
38-
type=int, default=50,
39+
type=int,
40+
default=50,
3941
metavar='INT',
4042
show_default=True,
4143
required_options=['email'],

src/cluecode/plugin_filter_clues.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class RedundantCluesFilter(PostScanPlugin):
5252

5353
options = [
5454
PluggableCommandLineOption(('--filter-clues',),
55-
is_flag=True, default=False,
55+
is_flag=True,
56+
default=False,
5657
help='Filter redundant duplicated clues already contained in '
5758
'detected license and copyright texts and notices.',
5859
help_group=POST_SCAN_GROUP)

src/cluecode/plugin_ignore_copyrights.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class IgnoreCopyrights(OutputFilterPlugin):
4343
options = [
4444
PluggableCommandLineOption(('--ignore-copyright-holder',),
4545
multiple=True,
46+
default=None,
4647
metavar='<pattern>',
4748
help='Ignore a file (and all its findings) if a copyright holder '
4849
'contains a match to the <pattern> regular expression. '
@@ -52,6 +53,7 @@ class IgnoreCopyrights(OutputFilterPlugin):
5253
PluggableCommandLineOption(
5354
('--ignore-author',),
5455
multiple=True,
56+
default=None,
5557
metavar='<pattern>',
5658
help='Ignore a file (and all its findings) if an author '
5759
'contains a match to the <pattern> regular expression. '

src/cluecode/plugin_url.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ class UrlScanner(ScanPlugin):
3131

3232
options = [
3333
PluggableCommandLineOption(('-u', '--url',),
34-
is_flag=True, default=False,
34+
is_flag=True,
35+
default=False,
3536
help='Scan <input> for urls.',
3637
help_group=OTHER_SCAN_GROUP),
3738

3839
PluggableCommandLineOption(('--max-url',),
39-
type=int, default=50,
40+
type=int,
41+
default=50,
4042
metavar='INT',
4143
required_options=['url'],
4244
show_default=True,

src/formattedcode/output_csv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class CsvOutput(OutputPlugin):
5454
options = [
5555
PluggableCommandLineOption(('--csv',),
5656
type=FileOptionType(mode='w', encoding='utf-8', lazy=True),
57+
default=None,
5758
metavar='FILE',
5859
help='[DEPRECATED] Write scan output as CSV to FILE. ' + DEPRECATED_MSG,
5960
help_group=OUTPUT_GROUP,

src/formattedcode/output_cyclonedx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ class CycloneDxJsonOutput(OutputPlugin):
795795
'output_cyclonedx_json',
796796
),
797797
type=FileOptionType(mode='w', encoding='utf-8', lazy=True),
798+
default=None,
798799
metavar='FILE',
799800
help='Write scan output in CycloneDX JSON format to FILE.',
800801
help_group=OUTPUT_GROUP,
@@ -825,6 +826,7 @@ class CycloneDxXmlOutput(OutputPlugin):
825826
'output_cyclonedx_xml',
826827
),
827828
type=FileOptionType(mode='w', encoding='utf-8', lazy=True),
829+
default=None,
828830
metavar='FILE',
829831
help='Write scan output in CycloneDX XML format to FILE.',
830832
help_group=OUTPUT_GROUP,

src/formattedcode/output_debian.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class DebianCopyrightOutput(OutputPlugin):
3333
options = [
3434
PluggableCommandLineOption(('--debian', 'output_debian',),
3535
type=FileOptionType(mode='w', lazy=True),
36+
default=None,
3637
metavar='FILE',
3738
help='Write scan output in machine-readable Debian copyright format to FILE.',
3839
help_group=OUTPUT_GROUP,

0 commit comments

Comments
 (0)