Skip to content

Commit 9a36910

Browse files
committed
fix string cleanup
1 parent 9981e16 commit 9a36910

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

command/pr_review.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ func prReview(cmd *cobra.Command, args []string) error {
153153
return err
154154
}
155155
// for now just return
156-
fmt.Fprintln(out, "done with patch mode, stopping here for now")
157156
return nil
158157
}
159158

@@ -429,7 +428,7 @@ func patchReview(cmd *cobra.Command) (*api.PullRequestReviewInput, error) {
429428
skipFile = false
430429
}
431430
}
432-
fmt.Fprintf(out, "%s\n\n", utils.Bold(hunk.File))
431+
fmt.Fprintf(out, "\n%s\n", utils.Bold(hunk.File))
433432
md := fmt.Sprintf("```diff\n%s\n```", hunk.Diff)
434433
rendered, err := utils.RenderMarkdown(md)
435434
if err != nil {
@@ -497,8 +496,8 @@ func patchReview(cmd *cobra.Command) (*api.PullRequestReviewInput, error) {
497496
}
498497
}
499498

500-
// TODO commentsMade ending up at 0, debug the string helpers.
501-
fmt.Fprintf(out, "\nWrapping up a review with %s comments.\n", utils.Bold(fmt.Sprintf("%d", commentsMade)))
499+
fmt.Fprintf(out, "\n\nWrapping up a review with %s.\n",
500+
utils.Bold(utils.Pluralize(commentsMade, "comment")))
502501

503502
reviewData, err := reviewSurvey(cmd)
504503

@@ -573,6 +572,6 @@ func trimBody(body string) string {
573572

574573
func isBlank(body string) bool {
575574
fmt.Println(body)
576-
r := regexp.MustCompile(`(?s)\w*`)
575+
r := regexp.MustCompile(`(?s)^\s*$`)
577576
return r.MatchString(body)
578577
}

0 commit comments

Comments
 (0)