Skip to content

Commit 9bd8bc5

Browse files
Rename flag name to --future-format
Renames flag to --future-format and updates help text test. Adds future format version. Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 795f701 commit 9bd8bc5

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

src/scancode/cli.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def print_version(ctx, param, value):
9494
if not value or ctx.resilient_parsing:
9595
return
9696
click.echo('ScanCode version ' + scancode_config.__version__)
97-
click.echo('ScanCode Data-format version ' + scancode_config.__output_format_version__)
97+
click.echo('Output Format version ' + scancode_config.__output_format_version__)
98+
click.echo('Future Output Format version ' + scancode_config.__future_output_format_version__)
9899
ctx.exit()
99100

100101

@@ -250,11 +251,11 @@ def validate_depth(ctx, param, value):
250251
'the starting directory. Use 0 for no scan depth limit.',
251252
help_group=cliutils.CORE_GROUP, sort_order=301, cls=PluggableCommandLineOption)
252253

253-
@click.option('--next-data-format',
254+
@click.option('--future-format',
254255
is_flag=True,
255256
help='Output the next experimental data format, for JSON and YAML output.'
256257
'See CHANGELOG for more details on the changes in this experimental data format.',
257-
help_group=cliutils.OUTPUT_GROUP, sort_order=28, cls=PluggableCommandLineOption)
258+
help_group=cliutils.OUTPUT_CONTROL_GROUP, sort_order=28, cls=PluggableCommandLineOption)
258259

259260

260261
@click.help_option('-h', '--help',
@@ -353,7 +354,7 @@ def scancode(
353354
verbose,
354355
max_depth,
355356
from_json,
356-
next_data_format,
357+
future_format,
357358
timing,
358359
max_in_memory,
359360
test_mode,
@@ -457,7 +458,7 @@ def scancode(
457458
quiet=quiet,
458459
verbose=verbose,
459460
max_depth=max_depth,
460-
next_data_format=next_data_format,
461+
future_format=future_format,
461462
timing=timing,
462463
max_in_memory=max_in_memory,
463464
test_mode=test_mode,
@@ -494,7 +495,7 @@ def scancode(
494495
def run_scan(
495496
input, # NOQA
496497
from_json=False,
497-
next_data_format=False,
498+
future_format=False,
498499
strip_root=False,
499500
full_root=False,
500501
max_in_memory=10000,
@@ -601,7 +602,7 @@ def echo_func(*_args, **_kwargs):
601602
quiet=quiet,
602603
verbose=verbose,
603604
from_json=from_json,
604-
next_data_format=next_data_format,
605+
future_format=future_format,
605606
timing=timing,
606607
max_in_memory=max_in_memory,
607608
test_mode=test_mode,

src/scancode_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def _create_dir(location):
7979
# See https://github.com/nexB/scancode-toolkit/issues/2653 for more information
8080
# on the data format version
8181
__output_format_version__ = '1.1'
82+
__future_output_format_version__ = '1.1'
83+
8284

8385
try:
8486
from pkg_resources import get_distribution, DistributionNotFound

tests/scancode/data/help/help.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,13 @@ Options:
7070
is not treated as findings).
7171

7272
output control:
73-
--full-root Report full, absolute paths.
74-
--strip-root Strip the root directory segment of all paths. The default is to
75-
always include the last directory segment of the scanned path
76-
such that all paths have a common root directory.
73+
--future-format Output the next experimental data format, for JSON and YAML
74+
output.See CHANGELOG for more details on the changes in this
75+
experimental data format.
76+
--full-root Report full, absolute paths.
77+
--strip-root Strip the root directory segment of all paths. The default is to
78+
always include the last directory segment of the scanned path
79+
such that all paths have a common root directory.
7780

7881
pre-scan:
7982
--ignore <pattern> Ignore files matching <pattern>.

0 commit comments

Comments
 (0)