go-github-pr-commenter icon indicating copy to clipboard operation
go-github-pr-commenter copied to clipboard

Incorrectly checking if line is in hunk when creating line comments

Open andrew-myer opened this issue 1 year ago • 1 comments

Describe the bug When using the Commenter's WriteMultiLineComment or WriteLineComment functions with a single-line edit, comments are returning CommentNotValidError errors because they are incorrectly determined to be outside of a hunk.

To Reproduce Steps to reproduce the behavior:

  1. Make a single line edit and use Commenter.WriteMultiLineComment or Commenter.WriteLineComment for that line
  2. CommentNotValidError is returned

Expected behavior If a line is in a hunk, the comment shouldn't be invalid.

andrew-myer avatar Apr 10 '24 16:04 andrew-myer

@owenrumney I setup a potential fix that's been working for my case #17 . Please let me know if any extra details/help is needed 😄

andrew-myer avatar Apr 10 '24 16:04 andrew-myer