homeport / dyff

/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
MIT License
1.32k stars 65 forks source link

Improved multiline string handling #333

Closed Arakos closed 9 months ago

Arakos commented 10 months ago

The multiline yaml-value change detection is currently not very useful (especially if color mode is off/not available) for huge text blocks (i.e. scripts, config-files, etc.) that are stored in a multiline string value.

Multiline string values will now render added/removed/changed lines as the string change detection logic go-diff detects. Unchanged lines will be truncated. Amount of unchanged lines to render around changes can be configured, default is 4.

Changes:

codecov[bot] commented 9 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (292c5cf) 82.79% compared to head (d4d9ed1) 82.86%. Report is 10 commits behind head on main.

Files Patch % Lines
pkg/dyff/output_human.go 96.22% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #333 +/- ## ========================================== + Coverage 82.79% 82.86% +0.06% ========================================== Files 14 14 Lines 1843 1862 +19 ========================================== + Hits 1526 1543 +17 - Misses 254 255 +1 - Partials 63 64 +1 ``` | [Flag](https://app.codecov.io/gh/homeport/dyff/pull/333/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=homeport) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/homeport/dyff/pull/333/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=homeport) | `82.86% <96.66%> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=homeport#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gotwarlost commented 9 months ago

This is such a lovely addition to an already awesome tool. Any chance of getting this merged?