softwaremill / diffx

Pretty diffs for scala case classes
Apache License 2.0
345 stars 30 forks source link

Objects with multi-line toString method are not rendered properly in diff results #433

Closed UnaiUribarri-TomTom closed 1 year ago

UnaiUribarri-TomTom commented 1 year ago

I have problem rendering results in a class like this:

// Some classes defined in https://github.com/openstreetmap/OSM-binary/blob/master/osmpbf/osmformat.proto
import org.osm.protobuf.Node
import org.osm.protobuf.Way
import org.osm.protobuf.Relation 

case class GeoMap(nodes: Seq[Node], ways: Seq[Way], relations: Seq[Relation])

Inner objects (Node, Way, Relation) are not properly indented and also, only the first line is highlighted when there is a difference.

I have posted PR #432 that resolves both issues.

UnaiUribarri-TomTom commented 1 year ago

I realised that the example provided did not trigger the issue. The issue was caused by a list of protobuf objects; protobuf defines a toString method that produces a multiline result. Updated the title of this issue.

ghostbuster91 commented 1 year ago

New version has been released with #432, should we close the issue?

ghostbuster91 commented 1 year ago

Thanks I've just noticed that the release build failed. I will try to fix it and retry later today.