Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit bb6c03c

Browse files
committed
Release 0.7.0
1 parent 278c184 commit bb6c03c

File tree

13 files changed

+134
-37
lines changed

13 files changed

+134
-37
lines changed

generated-docs/out/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Will result in:
7272

7373
![](https://github.com/softwaremill/diffx/blob/master/example.png?raw=true)
7474

75-
`diffx` is available for Scala 2.12 and 2.13 both jvm and js.
75+
`diffx` is available for Scala 3, 2.13 and 2.12 both jvm and js.
7676

7777
The core of `diffx` comes in a single jar.
7878

@@ -96,7 +96,7 @@ There is a number of similar projects from which diffx draws inspiration.
9696
Below is a list of some of them, which I am aware of, with their main differences:
9797
- [xotai/diff](https://github.com/xdotai/diff) - based on shapeless, seems not to be activly developed anymore
9898
- [ratatool-diffy](https://github.com/spotify/ratatool/tree/master/ratatool-diffy) - the main purpose is to compare large data sets stored on gs or hdfs
99-
99+
- [difflicious](https://github.com/jatcwang/difflicious) - very similar feature set, different design under the hood, no auto-derivation
100100

101101
## Sponsors
102102

@@ -132,7 +132,7 @@ a software development and consulting company. We help clients scale their busin
132132
133133
usage/derivation
134134
usage/ignoring
135-
usage/replacing
135+
usage/modifying
136136
usage/extending
137137
usage/sequences
138138
usage/output

generated-docs/out/integrations/cats.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This module contains integration layer between [org.typelevel.cats](https://gith
55
## sbt
66

77
```scala
8-
"com.softwaremill.diffx" %% "diffx-cats" % "0.6.0" % Test
8+
"com.softwaremill.diffx" %% "diffx-cats" % "0.7.0" % Test
99
```
1010

1111
## mill
1212

1313
```scala
14-
ivy"com.softwaremill.diffx::diffx-cats::0.6.0"
14+
ivy"com.softwaremill.diffx::diffx-cats::0.7.0"
1515
```
1616

1717
## Usage
@@ -37,7 +37,7 @@ compare(t1, t2)
3737
// name = "TestData",
3838
// fields = ListMap(
3939
// "ints" -> DiffResultObject(
40-
// name = "List",
40+
// name = "NonEmptyList",
4141
// fields = ListMap(
4242
// "0" -> DiffResultString(
4343
// diffs = List(

generated-docs/out/integrations/refined.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This module contains integration layer between [eu.timepit.refined](https://gith
55
## sbt
66

77
```scala
8-
"com.softwaremill.diffx" %% "diffx-refined" % "0.6.0" % Test
8+
"com.softwaremill.diffx" %% "diffx-refined" % "0.7.0" % Test
99
```
1010

1111
## mill
1212

1313
```scala
14-
ivy"com.softwaremill.diffx::diffx-refined::0.6.0"
14+
ivy"com.softwaremill.diffx::diffx-refined::0.7.0"
1515
```
1616

1717
## Usage

generated-docs/out/integrations/tagging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This module contains integration layer between [com.softwaremill.common.tagging]
55
## sbt
66

77
```scala
8-
"com.softwaremill.diffx" %% "diffx-tagging" % "0.6.0"
8+
"com.softwaremill.diffx" %% "diffx-tagging" % "0.7.0"
99
```
1010

1111
## mill
1212

1313
```scala
14-
ivy"com.softwaremill.diffx::diffx-tagging::0.6.0"
14+
ivy"com.softwaremill.diffx::diffx-tagging::0.7.0"
1515
```
1616

1717
## Usage

generated-docs/out/test-frameworks/munit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ To use with munit, add following dependency:
55
## sbt
66

77
```scala
8-
"com.softwaremill.diffx" %% "diffx-munit" % "0.6.0" % Test
8+
"com.softwaremill.diffx" %% "diffx-munit" % "0.7.0" % Test
99
```
1010

1111
## mill
1212

1313
```scala
14-
ivy"com.softwaremill.diffx::diffx-munit::0.6.0"
14+
ivy"com.softwaremill.diffx::diffx-munit::0.7.0"
1515
```
1616

1717
## Usage

generated-docs/out/test-frameworks/scalatest.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ To use with scalatest, add the following dependency:
66

77
For use with `should` matchers:
88
```scala
9-
"com.softwaremill.diffx" %% "diffx-scalatest-should" % "0.6.0" % Test
9+
"com.softwaremill.diffx" %% "diffx-scalatest-should" % "0.7.0" % Test
1010
```
1111

1212
For use with `must` matchers:
1313
```scala
14-
"com.softwaremill.diffx" %% "diffx-scalatest-should" % "0.6.0" % Test
14+
"com.softwaremill.diffx" %% "diffx-scalatest-must" % "0.7.0" % Test
1515
```
1616

1717
## mill
1818

1919
For use with `should` matchers:
2020
```scala
21-
ivy"com.softwaremill.diffx::diffx-scalatest-must::0.6.0"
21+
ivy"com.softwaremill.diffx::diffx-scalatest-must::0.7.0"
2222
```
2323

2424
For use with `must` matchers:
2525
```scala
26-
ivy"com.softwaremill.diffx::diffx-scalatest-must::0.6.0"
26+
ivy"com.softwaremill.diffx::diffx-scalatest-must::0.7.0"
2727
```
2828

2929
## Usage

generated-docs/out/test-frameworks/specs2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ To use with specs2, add the following dependency:
55
## sbt
66

77
```scala
8-
"com.softwaremill.diffx" %% "diffx-specs2" % "0.6.0" % Test
8+
"com.softwaremill.diffx" %% "diffx-specs2" % "0.7.0" % Test
99
```
1010

1111
## mill
1212

1313
```scala
14-
ivy"com.softwaremill.diffx::diffx-specs2::0.6.0"
14+
ivy"com.softwaremill.diffx::diffx-specs2::0.7.0"
1515
```
1616

1717
## Usage

generated-docs/out/test-frameworks/utest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ To use with utest, add following dependency:
55
## sbt
66

77
```scala
8-
"com.softwaremill.diffx" %% "diffx-utest" % "0.6.0" % Test
8+
"com.softwaremill.diffx" %% "diffx-utest" % "0.7.0" % Test
99
```
1010

1111
## mill
1212

1313
```scala
14-
ivy"com.softwaremill.diffx::diffx-utest::0.6.0"
14+
ivy"com.softwaremill.diffx::diffx-utest::0.7.0"
1515
```
1616

1717
## Usage

generated-docs/out/usage/derivation.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,22 @@ or extend trait
2121
`com.softwaremill.diffx.generic.auto.AutoDerivation`
2222

2323
**Auto derivation might have a huge impact on compilation times**, because of that it is recommended to use `semi-auto` derivation.
24+
25+
26+
Given that you have auto-derivation enabled you can summon diff instances as you would summon any other implicit type-class by using
27+
`implictly[Diff[T]]`. You can also write a shorter version `Diff[T]` which will be equivalent.
28+
However, if you would like to modify somehow (see [ignoring](./ignoring.md) and [modifying](./modifying.md)) given instance and
29+
put it back into to the implicit scope:
30+
```scala
31+
implict val diffForMyClass: Diff[MyClass] = Diff[MyClass].doSomething
32+
```
33+
you will get a forward reference error.
34+
35+
To overcome that issue there is a `Derived` wrapper which allows you to summon a wrapped instance.
36+
```scala
37+
implict val diffForMyClass: Diff[MyClass] = implicitly[Derived[Diff[MyClass]]].value.doSomething
38+
```
39+
There is a `summon` method to make it more convenient. Below code is equivalent to the one above.
40+
```scala
41+
implict val diffForMyClass: Diff[MyClass] = Diff.summon[MyClass].doSomething
42+
```

generated-docs/out/usage/ignoring.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ instance of the `Diff` typeclass into the implicit scope. The whole process look
1616

1717
```scala
1818
case class Person(name:String, age:Int)
19-
implicit val modifiedDiff: Diff[Person] = Derived[Diff[Person]].ignore(_.age)
19+
implicit val modifiedDiff: Diff[Person] = Diff.derived[Person].ignore(_.age)
2020
```
2121
```scala
2222
compare(Person("bob", 25), Person("bob", 30))
@@ -39,18 +39,18 @@ original comparison into ignored output:
3939
implicit val conf: DiffConfiguration = DiffConfiguration(makeIgnored =
4040
(original: Diff[Any]) =>
4141
(left: Any, right: Any, context: DiffContext) => {
42-
IdenticalValue(s"Ignored but was: ${original.apply(left, right, context).show()(ConsoleColorConfig.noColors)}")
42+
IdenticalValue(s"Ignored but was: ${original.apply(left, right, context).show()(ShowConfig.noColors)}")
4343
}
4444
)
4545
// conf: DiffConfiguration = DiffConfiguration(makeIgnored = <function1>)
4646
val d = Diff[Person].ignore(_.age)
47-
// d: Diff[Person] = com.softwaremill.diffx.Diff$$anon$1@2f232df9
47+
// d: Diff[Person] = com.softwaremill.diffx.Diff$$anon$1@71ed624c
4848
d(Person("bob", 25), Person("bob", 30))
4949
// res2: DiffResult = DiffResultObject(
5050
// name = "Person",
5151
// fields = ListMap(
5252
// "name" -> IdenticalValue(value = "bob"),
53-
// "age" -> IdenticalValue(value = "<ignored>")
53+
// "age" -> IdenticalValue(value = "Ignored but was: 25 -> 30")
5454
// )
5555
// )
5656
```

0 commit comments

Comments
 (0)