-
Notifications
You must be signed in to change notification settings - Fork 27
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
Adding headers of the deltacode output in the cli after writing to the json file is over #134
Conversation
@MaJuRG @pombredanne Please kindly review my PR .:) |
configure
Outdated
@@ -27,7 +27,7 @@ CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |||
if [[ "$PYTHON_EXE" == "" ]]; then | |||
PYTHON_EXE=python | |||
fi | |||
|
|||
PYTHON_EXE=python2.7 |
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.
What is this for?
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.
Actually I had 3 versions of python in my system to explicitly configure with py2.7 I was using it,else it was showing config errors(I am going to change it now)
src/deltacode/cli.py
Outdated
click.echo('deltacode_options: {') | ||
for option in deltacode.options: | ||
click.echo(""" "{}": "{}" """.format(option,deltacode.options[option])) | ||
click.echo("}") | ||
click.echo("""deltacode_version: "{}" """.format(__version__)) | ||
click.echo('deltacode_errors: {}'.format(collect_errors(deltacode))) | ||
click.echo('deltas_count: {}'.format(len([d for d in deltas(deltacode, all_delta_types)]))) |
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.
I do not really care to see these in the output. #130 is relating to just the Number of Deltas and what the different factors are.
I would like to see the counts of each particular Delta type (factors), not much else.
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.
Okay @MaJuRG sir so I am updating this part
@MaJuRG sir I updated it now |
src/deltacode/cli.py
Outdated
click.secho(get_notice(),fg="green") | ||
click.echo('deltas_count: {}'.format(len([d for d in deltas(deltacode, all_delta_types)]))) | ||
click.echo('delta_stats: {') | ||
for stat in deltacode.stats.to_dict(): | ||
click.echo(""" "{}": {}""".format(str(stat),deltacode.stats.to_dict()[stat])) | ||
click.echo("}") |
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.
I do not think we need to struture the output like a json file. It adds a lot of noise. I would rather it just be output as key: value
and not have JSON brackets or indentation
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.
@MaJuRG sir , updated the content
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.
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.
You did not sign off your last commit.
Also, you should improve your commit messages. A commit message of "Updates" tells me nothing of what has been done. See: https://chris.beams.io/posts/git-commit/
Please rebase your "updates" commits into a single commit and update the commit message to something more detailed using the link above.
51883d1
to
347b685
Compare
@MaJuRG sir, sorry for the delay and inconvenience ,I have made the changes |
configure
Outdated
@@ -27,7 +27,6 @@ CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |||
if [[ "$PYTHON_EXE" == "" ]]; then | |||
PYTHON_EXE=python | |||
fi | |||
|
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.
Re-add this line break
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.
@MaJuRG added the line break
5cbcf7a
to
e0f6000
Compare
src/deltacode/cli.py
Outdated
click.echo('deltas_count: {}'.format(len([d for d in deltas(deltacode, all_delta_types)]))) | ||
click.echo('delta_stats: ') | ||
for stat in deltacode.stats.to_dict(): | ||
click.echo(""" "{}": {}""".format(str(stat),deltacode.stats.to_dict()[stat])) |
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.
I do not think we want these unnecessary spaces in the output. Also, I would like the "stats" to be broken down by "factors" as this is more detailed.
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.
@MaJuRG ,I was actually providing the old_files_count ,files_modifies,files_moves....
in the stats part
What else should we provide ?
should we also provide the stats of new and old file path as it appears in the headers of the delta code json file?
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.
I would like the "stats" to be broken down by "factors" as this is more detailed.
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.
Yes we can provide the factors of each and every deltas in the cli ,and that is actually much elaborate ,however some deltas may be having empty arrays as its "factors" (in case of "added"...) ,what do we need to provide as "factors" in such a case?
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.
Then you just use the base status
value.
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.
Yes @MaJuRG I think we can provide both the status and factors for the deltas as that will actually much detailed
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.
@MaJuRG can you please review the changes.
@MaJuRG kindly review this, I made few changes Now I provided the the deltas which are modified in the CLI (deltas score,factors,old file ,new file...),so this is actually providing a bit more details to the end user about the deltas |
@MaJuRG can you review the changes |
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.
Can you show me what this looks like in the output?
src/deltacode/utils.py
Outdated
def get_notice_for_cli(): | ||
""" | ||
Retrieve the notice text from the NOTICE file for display in the Command Line . | ||
""" | ||
notice_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'NOTICE') | ||
notice_text = open(notice_path).read() | ||
|
||
delimiter = '\n\n\n' | ||
[notice_text, extra_notice_text] = notice_text.split(delimiter, 1) | ||
extra_notice_text = delimiter + extra_notice_text | ||
|
||
delimiter = '\n\n ' | ||
[notice_text, acknowledgment_text] = notice_text.split(delimiter, 1) | ||
acknowledgment_text = delimiter + acknowledgment_text | ||
|
||
notice = acknowledgment_text.strip().replace('\n', '') | ||
|
||
return notice |
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.
Why do we need this?
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.
@MaJuRG the screen shot which I provided it here is the output of this part (the green area)
@MaJuRG kindly review this, I made few changes
Now I provided the the deltas which are modified in the CLI (deltas score,factors,old file ,new file...),so this is actually providing a bit more details to the end user about the deltas
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.
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.
Why do we need this?
It is added to make the notice output in the CLI look better
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.
I do not want the notice displayed in the section.
@MaJuRG do I need to make some other changes in the CLI output part? |
a443d2d
to
d9973f8
Compare
@MaJuRG can you please review it again, I have some changes Now when we are printing the delta outputs in a json file then , I am providing a CLI , after the delta comparisons are required. I felt that it would be better not to have an additional CLI in the first case. |
|
||
simplejson.dump(results, outfile, iterable_as_array=True, indent=2) | ||
outfile.write('\n') | ||
if outfile.name != '<stdout>' : |
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.
This occours when the -j
option is in the json file
src/deltacode/utils.py
Outdated
def get_notice_for_cli(): | ||
""" | ||
Retrieve the notice text from the NOTICE file for display in the Command Line . | ||
""" | ||
notice_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'NOTICE') | ||
notice_text = open(notice_path).read() | ||
|
||
delimiter = '\n\n\n' | ||
[notice_text, extra_notice_text] = notice_text.split(delimiter, 1) | ||
extra_notice_text = delimiter + extra_notice_text | ||
|
||
delimiter = '\n\n ' | ||
[notice_text, acknowledgment_text] = notice_text.split(delimiter, 1) | ||
acknowledgment_text = delimiter + acknowledgment_text | ||
|
||
notice = acknowledgment_text.strip().replace('\n', '') | ||
|
||
return notice |
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.
I do not want the notice displayed in the section.
src/deltacode/cli.py
Outdated
click.secho("#" * 211 + "\n",fg="yellow") | ||
click.secho(" "*70 + "All deltas are generated, view the json file for details" + "\n" , fg="green") | ||
click.secho("#" * 211,fg="yellow") |
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 remove this. I dont really care for this output.
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.
@MaJuRG , I will be removing the notice
and this additional output sections
41fa884
to
85f7324
Compare
@MaJuRG , I made the changes in the output of the CLI part. Please suggest if some additional details are required :) |
Signed-off-by: Pratikrocks <[email protected]>
|
Regarding the number of lines changed ,it is more because I rebased the this branch to the tip of the develop branch, so as to reflect the changes here. I only changed the |
Closing due to stagnation. |
@MaJuRG sir I request review on it and all other or of mine a long back, and for many times I had asked |
@Pratikrocks Yes this may have fallen through the cracks, sorry about this lack of feedback. The deltacode repo has been updated since this PR was made with a number of configuration changes. If you can, please rebase your branch, or add your changes to a new branch off of the current develop |
Hi @MaJuRG , hope you are well,yes there are many changes currently :) |
Yes, deltacode is now python3. And yes, we are still looking to support |
Okay |
Signed off by: Pratik Dey [email protected]
referencing to issue #130
added headers of the deltacode output to the cli.