-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-diff: Do not inverse format if line consists of one change #8903
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8903 +/- ##
==========================================
+ Coverage 64.24% 64.24% +<.01%
==========================================
Files 275 275
Lines 11656 11658 +2
Branches 2844 2846 +2
==========================================
+ Hits 7488 7490 +2
Misses 3544 3544
Partials 624 624
Continue to review full report at Codecov.
|
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.
Yeah, great call!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
It distracts attention of reviewer if entire change line has inverse format
Test plan
Updated snapshots:
Realistic regression tests for the win: the code change was more subtle than I thought
Example pictures baseline at left and improved at right
The inverse lines fight for attention with the substrings within lines:
The inverse lines add insult to injury
when cleanup merges:from
andto
into changes because commono
is chaffTo set the record straight, merging
o
chaff intofrom
andto
changes is good cleanup. The problem is the length criterion where common substring'change '.length
does not have greater length than adjacent change substring'delete\n'.length
so is merged into changes.Notice the effect of one character increase in length to
'changed '