Skip to content
Permalink
Browse files

Run Scalafmt

  • Loading branch information...
travisbrown committed Nov 8, 2019
1 parent 6aa3567 commit 5c92fb9fc0cfc707541def2f41f363238ba424ac
Showing with 0 additions and 46 deletions.
  1. +0 −1 modules/core/shared/src/main/scala-2.12/io/circe/CollectionDecoders.scala
  2. +0 −1 modules/core/shared/src/main/scala-2.13/io/circe/CollectionDecoders.scala
  3. +0 −1 modules/core/shared/src/main/scala/io/circe/ACursor.scala
  4. +0 −2 modules/core/shared/src/main/scala/io/circe/CursorOp.scala
  5. +0 −5 modules/core/shared/src/main/scala/io/circe/Decoder.scala
  6. +0 −9 modules/core/shared/src/main/scala/io/circe/Encoder.scala
  7. +0 −1 modules/core/shared/src/main/scala/io/circe/Error.scala
  8. +0 −1 modules/core/shared/src/main/scala/io/circe/FailedCursor.scala
  9. +0 −1 modules/core/shared/src/main/scala/io/circe/Json.scala
  10. +0 −1 modules/core/shared/src/main/scala/io/circe/JsonNumber.scala
  11. +0 −2 modules/core/shared/src/main/scala/io/circe/JsonObject.scala
  12. +0 −2 modules/core/shared/src/main/scala/io/circe/Printer.scala
  13. +0 −2 modules/generic/shared/src/main/scala/io/circe/generic/util/macros/DerivationMacros.scala
  14. +0 −1 modules/generic/shared/src/test/scala/io/circe/generic/JsonCodecMacrosSuite.scala
  15. +0 −1 modules/jawn/src/main/scala/io/circe/jawn/JawnParser.scala
  16. +0 −1 modules/literal/src/main/scala/io/circe/literal/JsonLiteralMacros.scala
  17. +0 −1 modules/rs/src/main/scala/io/circe/rs/JsonF.scala
  18. +0 −1 modules/scalajs/src/main/scala/io/circe/scalajs/package.scala
  19. +0 −1 modules/shapes/src/main/scala/io/circe/shapes/LabelledHListInstances.scala
  20. +0 −1 modules/testing/shared/src/main/scala/io/circe/testing/ArbitraryInstances.scala
  21. +0 −2 modules/tests/shared/src/main/scala-2.12/io/circe/FactoryInstances.scala
  22. +0 −2 modules/tests/shared/src/main/scala-2.13/io/circe/FactoryInstances.scala
  23. +0 −1 modules/tests/shared/src/main/scala/io/circe/tests/CirceSuite.scala
  24. +0 −1 modules/tests/shared/src/test/scala/io/circe/AccumulatingDecoderSuite.scala
  25. +0 −1 modules/tests/shared/src/test/scala/io/circe/CodecSuites.scala
  26. +0 −1 modules/tests/shared/src/test/scala/io/circe/SortedKeysSuite.scala
  27. +0 −2 modules/tests/shared/src/test/scala/io/circe/rs/JsonFSuite.scala
@@ -6,7 +6,6 @@ import scala.collection.generic.CanBuildFrom
import scala.collection.mutable.Builder

private[circe] trait CollectionDecoders {

/**
* @note The resulting instance will not be serializable (in the `java.io.Serializable` sense)
* unless the provided [[scala.collection.generic.CanBuildFrom]] is serializable.
@@ -5,7 +5,6 @@ import scala.collection.{ Factory, Map }
import scala.collection.mutable.Builder

private[circe] trait CollectionDecoders {

/**
* @note The resulting instance will not be serializable (in the `java.io.Serializable` sense)
* unless the provided [[scala.collection.Factory]] is serializable.
@@ -34,7 +34,6 @@ import java.io.Serializable
* @author Travis Brown
*/
abstract class ACursor(private val lastCursor: HCursor, private val lastOp: CursorOp) extends Serializable {

/**
* The current location in the document.
*
@@ -4,7 +4,6 @@ import cats.{ Eq, Show }
import java.io.Serializable

sealed abstract class CursorOp extends Product with Serializable {

/**
* Does this operation require the current focus (not context) to be an
* object?
@@ -76,7 +75,6 @@ object CursorOp {

/** Shows history as JS style selections, i.e. ".foo.bar[3]" */
def opsToPath(history: List[CursorOp]): String = {

// Fold into sequence of selections (reducing array ops etc. into single selections)
val selections = history.foldRight(List.empty[Selection]) {
case (DownField(k), acc) => SelectField(k) :: acc
@@ -298,7 +298,6 @@ trait Decoder[A] extends Serializable { self =>
case l @ Invalid(_) => l.asInstanceOf[Decoder.AccumulatingResult[Either[A, B]]]
}
}

}

/**
@@ -443,7 +442,6 @@ object Decoder
with ProductDecoders
with LiteralDecoders
with LowPriorityDecoders {

/**
* @group Aliases
*/
@@ -1164,7 +1162,6 @@ object Decoder
}

private[this] abstract class StandardJavaTimeDecoder[A](name: String) extends JavaTimeDecoder[A](name) {

protected[this] final def formatMessage(input: String, message: String): String = message
}

@@ -1440,7 +1437,6 @@ object Decoder
* @group Utilities
*/
object state {

/**
* Attempt to decode a value at key `k` and remove it from the [[ACursor]].
*/
@@ -1475,7 +1471,6 @@ object Decoder
}

private[circe] trait LowPriorityDecoders {

/**
* @group Prioritization
*/
@@ -105,7 +105,6 @@ trait Encoder[A] extends Serializable { self =>
* @author Travis Brown
*/
object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders with MidPriorityEncoders {

/**
* Return an instance for a given type `A`.
*
@@ -734,7 +733,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
* @author Travis Brown
*/
object AsRoot extends LowPriorityAsRootEncoders {

/**
* Return an instance for a given type.
*
@@ -744,7 +742,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
}

private[circe] class LowPriorityAsRootEncoders {

/**
* @group Prioritization
*/
@@ -798,7 +795,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
* @author Travis Brown
*/
object AsArray extends LowPriorityAsArrayEncoders {

/**
* Return an instance for a given type.
*
@@ -824,7 +820,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
}

private[circe] class LowPriorityAsArrayEncoders {

/**
* @group Prioritization
*/
@@ -878,7 +873,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
* @author Travis Brown
*/
object AsObject extends LowPriorityAsObjectEncoders {

/**
* Return an instance for a given type.
*
@@ -904,7 +898,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
}

private[circe] class LowPriorityAsObjectEncoders {

/**
* @group Prioritization
*/
@@ -916,7 +909,6 @@ object Encoder extends TupleEncoders with ProductEncoders with LiteralEncoders w
}

private[circe] trait MidPriorityEncoders extends LowPriorityEncoders {

/**
* @group Collection
*/
@@ -945,7 +937,6 @@ private[circe] trait MidPriorityEncoders extends LowPriorityEncoders {
}

private[circe] trait LowPriorityEncoders {

/**
* @group Prioritization
*/
@@ -96,7 +96,6 @@ object DecodingFailure {
val path = CursorOp.opsToPath(failure.history)
s"DecodingFailure at ${path}: ${failure.message}"
}

}

object Error {
@@ -3,7 +3,6 @@ package io.circe
import cats.Applicative

final class FailedCursor(lastCursor: HCursor, lastOp: CursorOp) extends ACursor(lastCursor, lastOp) {

/**
* Indicates whether the last operation failed because the type of the focus
* was wrong.
@@ -227,7 +227,6 @@ sealed abstract class Json extends Product with Serializable {
}

object Json {

/**
* Represents a set of operations for reducing a [[Json]] instance to a value.
*/
@@ -219,7 +219,6 @@ private[circe] final case class JsonFloat(value: Float) extends JsonNumber {
* Constructors, type class instances, and other utilities for [[JsonNumber]].
*/
object JsonNumber {

/**
* Return a `JsonNumber` whose value is the valid JSON number in `value`.
*
@@ -24,7 +24,6 @@ import scala.collection.immutable.Map
* @groupprio Other 3
*/
sealed abstract class JsonObject extends Serializable {

/**
* Return the JSON value associated with the given key, with undefined behavior if there is none.
*
@@ -210,7 +209,6 @@ sealed abstract class JsonObject extends Serializable {
* Constructors, type class instances, and other utilities for [[JsonObject]].
*/
object JsonObject {

/**
* Construct a [[JsonObject]] from the given key-value pairs.
*/
@@ -237,7 +237,6 @@ final case class Printer(
}

object Printer {

/**
* A pretty-printer configuration that inserts no spaces.
*/
@@ -485,7 +484,6 @@ object Printer {
cs: Charset,
sizePredictor: SizePredictor
) extends Appendable {

private[this] var index = 0
private[this] var chars = new Array[Char](sizePredictor.predictSize)

@@ -71,7 +71,6 @@ abstract class DerivationMacros[RD[_], RE[_], RC[_], DD[_], DE[_], DC[_]] {
* that's more convenient to work with.
*/
private[this] class Members(val underlying: List[Member]) {

/**
* Fold over the elements of this (co-)product while accumulating instances
* of some type class for each.
@@ -118,7 +117,6 @@ abstract class DerivationMacros[RD[_], RE[_], RC[_], DD[_], DE[_], DC[_]] {

object Entry {
def unapply(tpe: Type): Option[(String, Type, Type)] = tpe.dealias match {

/**
* Before Scala 2.12 the `RefinedType` extractor returns the field type
* (including any refinements) as the first result in the list.
@@ -11,7 +11,6 @@ import org.scalacheck.{ Arbitrary, Gen }
package object jsoncodecmacrossuiteaux extends AnyRef with AllInstances with ArbitraryInstances with MissingInstances

package jsoncodecmacrossuiteaux {

// Simple

@JsonCodec final case class Simple(i: Int, l: Long, s: String)
@@ -7,7 +7,6 @@ import java.nio.ByteBuffer
import scala.util.{ Failure, Success, Try }

object JawnParser {

/**
* Returns a parser that fails on:
* <ul>
@@ -24,7 +24,6 @@ class JsonLiteralMacros(val c: blackbox.Context) {
private[this] final def generatePlaceholder(): String = UUID.randomUUID().toString

def apply(stringParts: Seq[String], argument: Tree): Replacement = {

/**
* Generate a unique string that doesn't appear in the JSON literal.
*/
@@ -100,5 +100,4 @@ object JsonF {
def onObject(value: JsonObject) =
JObjectF(value.toVector)
}

}
@@ -5,7 +5,6 @@ import scala.scalajs.js.JSConverters._
import scala.util.control.NonFatal

package object scalajs {

/**
* Attempt to convert a value to [[Json]].
*/
@@ -7,7 +7,6 @@ import shapeless.{ ::, HList, Widen, Witness }
import shapeless.labelled.{ FieldType, field }

trait LabelledHListInstances extends LowPriorityLabelledHListInstances {

/**
* Decode a record element with a symbol key.
*
@@ -19,7 +19,6 @@ import io.circe.rs.JsonF.{ JArrayF, JBooleanF, JNullF, JNumberF, JObjectF, JStri
import org.scalacheck.{ Arbitrary, Cogen, Gen }

trait ArbitraryInstances extends ArbitraryJsonNumberTransformer with CogenInstances with ShrinkInstances {

/**
* The maximum depth of a generated JSON value.
*/
@@ -5,7 +5,6 @@ import scala.collection.mutable.{ ArrayBuilder, Builder }
import scala.reflect.ClassTag

trait ArrayFactoryInstance {

/**
* We need serializable `CanBuildFrom` instances for arrays for our `Array` codec tests.
*/
@@ -17,7 +16,6 @@ trait ArrayFactoryInstance {
}

trait StreamFactoryInstance {

/**
* We need serializable `CanBuildFrom` instances for streams for our `NonEmptyStream` codec tests.
*/
@@ -5,7 +5,6 @@ import scala.collection.mutable.{ ArrayBuffer, ArrayBuilder, Builder }
import scala.reflect.ClassTag

trait ArrayFactoryInstance {

/**
* We need serializable `Factory` instances for arrays for our `Array` codec tests.
*/
@@ -17,7 +16,6 @@ trait ArrayFactoryInstance {
}

trait StreamFactoryInstance {

/**
* We need serializable `Factory` instances for streams for our `NonEmptyStream` codec tests.
*/
@@ -33,7 +33,6 @@ trait CirceSuite
with ArbitraryInstances
with EqInstances
with MissingInstances {

override def convertToEqualizer[T](left: T): Equalizer[T] =
sys.error("Intentionally ambiguous implicit for Equalizer")

@@ -101,5 +101,4 @@ class AccumulatingDecoderSpec extends CirceSuite {
assert(errors.map(df => cursor.replay(df.history).focus) === invalidElems)
}
}

}
@@ -21,7 +21,6 @@ import scala.collection.immutable.SortedMap
import scala.collection.mutable.HashMap

trait SpecialEqForFloatAndDouble {

/**
* We provide a special [[cats.kernel.Eq]] instance for [[scala.Float]] that does not distinguish
* `NaN` from itself.
@@ -26,5 +26,4 @@ trait SortedKeysSuite { this: PrinterSuite =>
keys.sorted === keys
})
}

}
@@ -6,7 +6,6 @@ import io.circe.rs.JsonF.{ foldJson, unfoldJson }
import io.circe.tests.CirceSuite

class JsonFSuite extends CirceSuite {

checkLaws("Traverse[JsonF]", TraverseTests[JsonF].traverse[Int, Int, Int, Set[Int], Option, Option])

"fold then unfold" should "be identity " in forAll { jsonF: JsonF[Json] =>
@@ -16,5 +15,4 @@ class JsonFSuite extends CirceSuite {
"unfold then fold" should "be identity " in forAll { json: Json =>
assert(foldJson(unfoldJson(json)) === json)
}

}

0 comments on commit 5c92fb9

Please sign in to comment.
You can’t perform that action at this time.