gnieh / diffson

@@ -19,8 +19,6 @@
Loading
19 19
import cats.implicits._
20 20
import cats.data.Chain
21 21
22 -
import io.estatico.newtype.macros.newtype
23 -
24 22
import scala.util.Try
25 23
26 24
import scala.language.{ implicitConversions, higherKinds }
@@ -30,7 +28,7 @@
Loading
30 28
package object jsonpointer {
31 29
32 30
  type Part = Either[String, Int]
33 -
  @newtype case class Pointer(parts: Chain[Part]) {
31 +
  case class Pointer private[jsonpointer] (parts: Chain[Part]) extends AnyVal {
34 32
35 33
    def /(s: String): Pointer =
36 34
      Pointer(parts.append(Left(s)))
@@ -64,7 +62,7 @@
Loading
64 62
    private val IsNumber = "(0|[1-9][0-9]*)".r
65 63
66 64
    def apply(elems: String*): Pointer = Pointer(Chain.fromSeq(elems.map {
67 -
      case s @ IsNumber(idx) => Try(idx.toInt).liftTo[Either[Throwable, ?]].leftMap(_ => s)
65 +
      case s @ IsNumber(idx) => Try(idx.toInt).liftTo[Either[Throwable, *]].leftMap(_ => s)
68 66
      case key               => Left(key)
69 67
    }))
70 68
@@ -113,7 +111,7 @@
Loading
113 111
  object Inner {
114 112
115 113
    def unapply(parts: Pointer): Option[(Part, Pointer)] =
116 -
      parts.parts.uncons.map { case (h, t) => (h, Pointer(t)) }
114 +
      parts.parts.uncons.map { case (h, t) => (h, new Pointer(t)) }
117 115
118 116
  }
119 117

@@ -56,7 +56,7 @@
Loading
56 56
    Encoder[String].contramap(_.show)
57 57
58 58
  implicit val pointerDecoder: Decoder[Pointer] =
59 -
    Decoder[String].emap(Pointer.parse[Either[Throwable, ?]](_).leftMap(_.getMessage))
59 +
    Decoder[String].emap(Pointer.parse[Either[Throwable, *]](_).leftMap(_.getMessage))
60 60
61 61
  implicit val operationEncoder: Encoder[Operation[Json]] =
62 62
    Encoder.instance[Operation[Json]] {

@@ -34,7 +34,7 @@
Loading
34 34
class Hashed[T: Eq](val value: T) {
35 35
  override val hashCode: Int = value.hashCode()
36 36
  override def equals(other: Any): Boolean = other match {
37 -
    case that: Hashed[T] => this === that
38 -
    case _               => false
37 +
    case that: Hashed[T] @unchecked => this === that
38 +
    case _                          => false
39 39
  }
40 40
}

@@ -104,7 +104,7 @@
Loading
104 104
            case JsString("remove") =>
105 105
              obj.getFields("path", "old") match {
106 106
                case Seq(JsString(path)) =>
107 -
                  Remove(Pointer.parse[Try](path).get)
107 +
                  Remove(Pointer.parse[Try](path).get, None)
108 108
                case Seq(JsString(path), old) =>
109 109
                  Remove(Pointer.parse[Try](path).get, Some(old))
110 110
                case _ =>
@@ -113,7 +113,7 @@
Loading
113 113
            case JsString("replace") =>
114 114
              obj.getFields("path", "value", "old") match {
115 115
                case Seq(JsString(path), value) =>
116 -
                  Replace(Pointer.parse[Try](path).get, value)
116 +
                  Replace(Pointer.parse[Try](path).get, value, None)
117 117
                case Seq(JsString(path), value, old) =>
118 118
                  Replace(Pointer.parse[Try](path).get, value, Some(old))
119 119
                case _ =>
Files Coverage
core/src/main/scala/diffson 96.32%
playJson/shared/src/main/scala/diffson/playJson 75.41%
sprayJson/src/main/scala/gnieh/diffson/sprayJson 75.64%
circe/shared/src/main/scala/diffson/circe/package.scala 85.51%
Project Totals (16 files) 89.15%
465.1
TRAVIS_JDK_VERSION=openjdk8
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading