Skip to content

Commit

Permalink
Merge pull request #278 from k1LoW/remove-title
Browse files Browse the repository at this point in the history
Remove title if three metrics are not mesured
  • Loading branch information
k1LoW authored Sep 30, 2023
2 parents 547dfaf + 62a5d32 commit 3b418fd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ func createReportContent(ctx context.Context, c *config.Config, r, rPrev *report
}
}

title := r.Title()
comment := []string{fmt.Sprintf("## %s", title)}

var comment []string
if r.IsMeasuredCoverage() || r.IsMeasuredTestExecutionTime() || r.IsMeasuredCodeToTestRatio() {
comment = append(comment, fmt.Sprintf("## %s", r.Title()))
}
if err := c.Acceptable(r, rPrev); err != nil {
merr, ok := err.(*multierror.Error) //nolint:errorlint
if !ok {
Expand All @@ -98,8 +99,9 @@ func createReportContent(ctx context.Context, c *config.Config, r, rPrev *report
}
comment = append(comment, merr.Error())
}

comment = append(comment, table, "", fileTable)
if r.IsMeasuredCoverage() || r.IsMeasuredTestExecutionTime() || r.IsMeasuredCodeToTestRatio() {
comment = append(comment, table, "", fileTable)
}
comment = append(comment, customTables...)
comment = append(comment, "---", footer)

Expand Down

0 comments on commit 3b418fd

Please sign in to comment.