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

Fix source file merge #272

Merged
merged 2 commits into from
Dec 13, 2017
Merged

Fix source file merge #272

merged 2 commits into from
Dec 13, 2017

Conversation

ale7714
Copy link
Contributor

@ale7714 ale7714 commented Dec 12, 2017

  • Instead of checking for len of coverage, merge file only
    when blob id matches

* Instead of checking for len of coverage, merge file only
  when blob id matches`
Copy link
Contributor

@wfleming wfleming left a comment

Choose a reason for hiding this comment

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

Minor bit of feedback on copy. Other than that, I think you just need to run go fmt on all these files. Aside that from that, this looks great.

@@ -47,3 +47,11 @@ func (c *Coverage) UnmarshalJSON(text []byte) error {
*c = cc
return nil
}

func (c *Coverage) AppendNulls(quantity int) Coverage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, I'd seen this basic pattern a bunch of places, we can probably use it across a bunch of formatters later!

@@ -35,6 +35,7 @@ func Test_Report_Merge_MismatchedCoverageLength(t *testing.T) {
SourceFiles: SourceFiles{
"a.go": {
Name: "a.go",
BlobID: "a",
Copy link
Contributor

Choose a reason for hiding this comment

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

💄 Looks to me like you need to run go fmt?

if len(a.Coverage) != len(b.Coverage) {
return a, errors.Errorf("coverage length mismatch for %s", a.Name)
if a.BlobID != b.BlobID {
return a, errors.Errorf("Failed to merge coverage for source file %s. BlobID mismatch", a.Name)
Copy link
Contributor

@wfleming wfleming Dec 12, 2017

Choose a reason for hiding this comment

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

It's a little odd to treat the first part as a proper sentence with a period but the end of the message is a sentence fragment without punctuation. Can we use : instead of . so the message is more similar in grammatical structure to other messages?

@ale7714 ale7714 merged commit 0e6a38f into master Dec 13, 2017
@ale7714 ale7714 deleted the ap/fix-sum-coverage branch December 13, 2017 15:30
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.

None yet

2 participants