-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle addition-only and deletion-only changes #144
fix: handle addition-only and deletion-only changes #144
Conversation
Codecov Report
@@ Coverage Diff @@
## master #144 +/- ##
==========================================
+ Coverage 86.30% 86.88% +0.58%
==========================================
Files 41 43 +2
Lines 3986 4178 +192
Branches 311 339 +28
==========================================
+ Hits 3440 3630 +190
- Misses 538 540 +2
Partials 8 8
Continue to review full report at Codecov.
|
expect(invalidHunks.size).to.equal(0); | ||
}); | ||
|
||
it('allows an addition only suggestion at the beginning of the range', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are looking really solid, excited to see this moving forward 👍
🤖 I have created a release \*beep\* \*boop\* --- ## [1.8.0](https://www.github.com/googleapis/code-suggester/compare/v1.7.0...v1.8.0) (2020-10-09) ### Features * **review:** allow raw diff for reviewPullRequest ([#137](https://www.github.com/googleapis/code-suggester/issues/137)) ([841526d](https://www.github.com/googleapis/code-suggester/commit/841526d720b6af4a21cf3ab08e5749a812fb5c30)) ### Bug Fixes * handle addition-only and deletion-only changes ([#144](https://www.github.com/googleapis/code-suggester/issues/144)) ([ab936a2](https://www.github.com/googleapis/code-suggester/commit/ab936a251171ca5aafc160f3506db54a7cb31e8a)), closes [#126](https://www.github.com/googleapis/code-suggester/issues/126) [#127](https://www.github.com/googleapis/code-suggester/issues/127) * the review comment should go on the old file lines, not the new file lines ([#140](https://www.github.com/googleapis/code-suggester/issues/140)) ([662391f](https://www.github.com/googleapis/code-suggester/commit/662391f2ae18e8ec997e0961430ce3ccc6f11cee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
When partitioning valid hunks from invalid hunks, if we detect addition-only or deletion-only changes, modify the hunk to include the previous or next line after the change (assuming it still fits in the valid commentable lines).
Fixes #126
Fixes #127