Skip to content
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

Total & remaining rows, and csv output for diff. #98

Merged
merged 1 commit into from
Jul 28, 2018

Conversation

data-pup
Copy link
Member

Continued work for #88. This PR adds a total and remaining row to the output of the diff subcommand, as well as emitting CSV output!

I ended up moving a lot of the duplicated work in the text and json emission into the diff function itself, which helped make these much more concise as well :)

@data-pup data-pup force-pushed the add-diff-summary-pr branch from 6484838 to ea70105 Compare July 26, 2018 02:26
@data-pup
Copy link
Member Author

The test build for 1.27.2 seems to have stalled, but it did pass locally. We can try that again after review, but it should work :)

@data-pup data-pup requested a review from fitzgen July 26, 2018 03:04
@fitzgen
Copy link
Member

fitzgen commented Jul 26, 2018

I ended up moving a lot of the duplicated work in the text and json emission into the diff function itself, which helped make these much more concise as well :)

\o/ Nice!

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

LGTM! I restarted the CI job, if it comes back green feel free to merge!

@@ -1119,6 +1121,18 @@ impl Ord for DiffEntry {
}
}

impl serde::Serialize for DiffEntry {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to implement this by hand rather than to use #[derive(Serialize)]?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah! This was implemented manually because the delta value should have its sign shown even if it is positive. The derived implementation matched tests for the negative values, but positive values were missing the +.

If there's a way to do this with serde macros though, I'm happy to follow up and fix that :)

@data-pup data-pup merged commit e11ef3d into rustwasm:master Jul 28, 2018
@data-pup data-pup deleted the add-diff-summary-pr branch February 28, 2019 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants