-
-
Notifications
You must be signed in to change notification settings - Fork 27
Add limited delta stats after running #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,16 @@ def print_version(ctx, param, value): | |
| click.echo('DeltaCode version ' + __version__) | ||
| ctx.exit() | ||
|
|
||
| def print_summary(new,old,deltas_count): | ||
| 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') | ||
|
|
@@ -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)]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment.
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