Skip to content

Commit

Permalink
feat: [CODE-1788]: code comment block must start and end on the same …
Browse files Browse the repository at this point in the history
…side (#2053)
  • Loading branch information
marko-gacesa authored and Harness committed May 22, 2024
1 parent f66bfa1 commit 0d1e536
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/api/controller/pullreq/comment_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func (in *CommentCreateInput) Validate() error {
return usererror.BadRequest("code comments require line numbers")
}

if in.LineStartNew && !in.LineEndNew || !in.LineStartNew && in.LineEndNew {
return usererror.BadRequest("code block must start and end on the same side")
}

return nil
}

Expand Down

0 comments on commit 0d1e536

Please sign in to comment.