Skip to content

Commit

Permalink
github-pr-review: minor improvement of suggestion error
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Jul 25, 2020
1 parent ceafe32 commit b39b8f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion service/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func buildSingleSuggestion(c *reviewdog.Comment, s *rdf.Suggestion) (string, err
drange := c.Result.Diagnostic.GetLocation().GetRange()
if start.GetLine() != drange.GetStart().GetLine() ||
end.GetLine() != drange.GetEnd().GetLine() {
return "", fmt.Errorf("the Diagnostic's lines and Suggestion lines must be the same. %d-%d v.s. %d-%d",
return "", fmt.Errorf("the Diagnostic's lines and Suggestion lines must be the same. L%d-L%d v.s. L%d-L%d",
drange.GetStart().GetLine(), drange.GetEnd().GetLine(), start.GetLine(), end.GetLine())
}
if start.GetColumn() > 0 || end.GetColumn() > 0 {
Expand Down
2 changes: 1 addition & 1 deletion service/github/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func TestGitHubPullRequest_Post_Flush_review_api(t *testing.T) {
Line: github.Int(16),
Body: github.String(commentutil.BodyPrefix + "\n" + strings.Join([]string{
"invalid lines suggestion comment",
invalidSuggestionPre + "the Diagnostic's lines and Suggestion lines must be the same. 15-16 v.s. 16-17" + invalidSuggestionPost,
invalidSuggestionPre + "the Diagnostic's lines and Suggestion lines must be the same. L15-L16 v.s. L16-L17" + invalidSuggestionPost,
}, "\n") + "\n"),
},
{
Expand Down

0 comments on commit b39b8f6

Please sign in to comment.