Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/deltacode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ def print_version(ctx, param, value):
click.echo('DeltaCode version ' + __version__)
ctx.exit()

def print_summary(new,old,deltas_count):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a space after the comma for each of these args

click.echo(click.style('Delta check done.', fg='green'))
if deltas_count == 0:
click.echo('Summary: The two codebases are identical.')
else:
click.echo('Summary: The two codebases differ.')
click.echo('New file: {}'.format(new))
click.echo('Old file: {}'.format(old))
click.echo('Deltas count: {}'.format(deltas_count))
click.echo(click.style('For more information check out the json file.', fg='green'))

@click.command()
@click.help_option('-h', '--help')
Expand Down Expand Up @@ -91,3 +101,7 @@ def cli(new, old, json_file, all_delta_types):

# generate JSON output
write_json(deltacode, json_file, all_delta_types)

# show limited delta status
deltas_count = len([d for d in deltas(deltacode, all_delta_types)])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see the counts of each particular Delta type, not the total number of deltas.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you would like to see the counts of each type of "factor" for each delta? That is to say factors can be for example "added", "license info added", "moved" etc. and you would like to see the counts of these such factors, lets say we have 5 "added", 3 "moved" etc.

@steven-esser steven-esser Mar 11, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I should have clarified that :)

You can treat Deltas with multiple factors as their own entity for the sake of the counts

Also, I would be curious to known the performance implications of generating these counts is. We may want to add this feature as a runtime option if it takes a long time on large datasets.

print_summary(new,old,deltas_count)