-
Notifications
You must be signed in to change notification settings - Fork 76
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
Conversation
* Instead of checking for len of coverage, merge file only when blob id matches`
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.
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 { |
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.
Nice, I'd seen this basic pattern a bunch of places, we can probably use it across a bunch of formatters later!
formatters/report_test.go
Outdated
@@ -35,6 +35,7 @@ func Test_Report_Merge_MismatchedCoverageLength(t *testing.T) { | |||
SourceFiles: SourceFiles{ | |||
"a.go": { | |||
Name: "a.go", | |||
BlobID: "a", |
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.
💄 Looks to me like you need to run go fmt
?
formatters/source_file.go
Outdated
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) |
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.
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?
when blob id matches