go-github-pr-commenter
go-github-pr-commenter copied to clipboard
Incorrectly checking if line is in hunk when creating line 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:
- Make a single line edit and use
Commenter.WriteMultiLineCommentorCommenter.WriteLineCommentfor that line - CommentNotValidError is returned
Expected behavior If a line is in a hunk, the comment shouldn't be invalid.
@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 😄