Repositories

Omar Jarjur <ojarjur@google.com>
3a425d Submitting review f68fceaba6b5
Omar Jarjur committed at 2015-12-16 16:24:21

Added error message for leaving empty comments This commit requires that for a comment, if -lgtm AND -nmw have not been set a comment must be.

As per https://github.com/google/git-appraise/issues/8#issuecomment-165078292

Modified commands/comment.go

@@ -43,6 +43,9 @@ func commentOnReview(repo repository.Repo, args []string) error {
if *commentLgtm && *commentNmw {
return errors.New("You cannot combine the flags -lgtm and -nmw.")
}
if !*commentLgtm && !*commentNmw && *commentMessage == "" {
return errors.New("Message cannot be empty if neither the -lgtm or -nmw flag has been set.")
}
if *commentLine != 0 && *commentFile == "" {
return errors.New("Specifying a line number with the -l flag requires that you also specify a file name with the -f flag.")
}