Skip to content

Commit

Permalink
Reformat with scalafmt 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scala-steward authored and mergify[bot] committed Aug 20, 2021
1 parent 4b0a314 commit 0b4e6e5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ lazy val commonSettings = Seq(
case _ => opts
}
},
Test / fork := true,
Test / fork := true,
libraryDependencies ++= Seq(Dependencies.scalatest, Dependencies.estatico, Dependencies.supertagged).map(_ % Test),
resolvers += Resolver.sonatypeRepo("releases"),
)

lazy val noPublishSettings =
commonSettings ++ Seq(publish := {}, publishArtifact := false, publishTo := None, publish / skip := true)

lazy val publishSettings = commonSettings ++ Seq(
pomIncludeRepository := { _ =>
lazy val publishSettings = commonSettings ++ Seq(
pomIncludeRepository := { _ =>
false
},
Test / publishArtifact := false
Expand Down
16 changes: 8 additions & 8 deletions ci-release.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / scalaVersion := Dependencies.Version.scala213
ThisBuild / crossScalaVersions := Seq(
ThisBuild / scalaVersion := Dependencies.Version.scala213
ThisBuild / crossScalaVersions := Seq(
Dependencies.Version.scala213,
Dependencies.Version.scala212
)
Expand All @@ -9,7 +9,7 @@ ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.StartsWith(Ref.Tag("v"))
)

ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]", "[email protected]")
ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]", "[email protected]")

ThisBuild / githubWorkflowBuildPreamble += WorkflowStep.Sbt(
List("scalafmtCheckAll", "scalafmtSbtCheck"),
Expand All @@ -29,20 +29,20 @@ ThisBuild / githubWorkflowPublish := Seq(
)
)

ThisBuild / versionScheme := Some("early-semver")
ThisBuild / versionScheme := Some("early-semver")

ThisBuild / licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild / developers := List(
ThisBuild / developers := List(
Developer(
"Odomontois",
"Oleg Nizhnik",
"[email protected]",
url("https://github.com/Odomontois")
)
)
ThisBuild / homepage := Some(url("https://manatki.org/docs/derevo"))
ThisBuild / scmInfo := Some(
ThisBuild / homepage := Some(url("https://manatki.org/docs/derevo"))
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/tofu-tf/derevo"), "scm:git:[email protected]:tofu-tf/derevo.git")
)
ThisBuild / organization := "tf.tofu"
ThisBuild / organization := "tf.tofu"
ThisBuild / organizationName := "Tofu"
21 changes: 14 additions & 7 deletions modules/circe/src/main/scala/derevo/circe/circe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import derevo.SpecificDerivation
object decoder extends Derivation[Decoder] with NewTypeDerivation[Decoder] {
def instance[A]: Decoder[A] = macro Derevo.delegate[Decoder, A]

/** @param arg1 naming function. For example io.circe.derivation.renaming.snakeCase
* @param arg2 useDefaults
* @param arg3 type discriminator name
/** @param arg1
* naming function. For example io.circe.derivation.renaming.snakeCase
* @param arg2
* useDefaults
* @param arg3
* type discriminator name
*/
def apply[A](arg1: String => String, arg2: Boolean, arg3: Option[String]): Decoder[A] =
macro Derevo.delegateParams3[Decoder, A, String => String, Boolean, Option[String]]
Expand All @@ -22,8 +25,10 @@ object decoder extends Derivation[Decoder] with NewTypeDerivation[Decoder] {
object encoder extends SpecificDerivation[Encoder, Encoder.AsObject, Encoder] with NewTypeDerivation[Encoder] {
def instance[A]: Encoder.AsObject[A] = macro Derevo.delegate[Encoder.AsObject, A]

/** @param arg1 naming function. For example io.circe.derivation.renaming.snakeCase
* @param arg2 type discriminator name
/** @param arg1
* naming function. For example io.circe.derivation.renaming.snakeCase
* @param arg2
* type discriminator name
*/
def apply[A](arg1: String => String, arg2: Option[String]): Encoder.AsObject[A] =
macro Derevo.delegateParams2[Encoder.AsObject, A, String => String, Option[String]]
Expand All @@ -33,8 +38,10 @@ object encoder extends SpecificDerivation[Encoder, Encoder.AsObject, Encoder] wi
object codec extends SpecificDerivation[Codec, Codec.AsObject, Codec] with NewTypeDerivation[Codec] {
def instance[A]: Codec.AsObject[A] = macro Derevo.delegate[Codec.AsObject, A]

/** @param arg1 naming function. For example io.circe.derivation.renaming.snakeCase
* @param arg2 type discriminator name
/** @param arg1
* naming function. For example io.circe.derivation.renaming.snakeCase
* @param arg2
* type discriminator name
*/
def apply[A](arg1: String => String, arg2: Boolean, arg3: Option[String]): Codec.AsObject[A] =
macro Derevo.delegateParams3[Codec.AsObject, A, String => String, Boolean, Option[String]]
Expand Down
3 changes: 1 addition & 2 deletions modules/core/src/main/scala/derevo/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ package derevo {
def macroTransform(annottees: Any*): Any = macro Derevo.deriveMacro
}

/**
*/
/** */
trait PassTypeArgs
trait KeepRefinements

Expand Down
13 changes: 5 additions & 8 deletions modules/tests/src/main/scala/derevo/tests/Jampa.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ object JJ {
type EncoderOpt[U[_[_]]] = Encoder[U[Option]]
}

/** this is basic macro derivation method
* unfortunately then calling a macro having higher-kinded type parameter
* scala refuses to infer the type and Derevo should pass argument to it explicitly
* this is where the trait PassTypeArgs is helpful
/** this is basic macro derivation method unfortunately then calling a macro having higher-kinded type parameter scala
* refuses to infer the type and Derevo should pass argument to it explicitly this is where the trait PassTypeArgs is
* helpful
*/
object Jampa extends DerivationKN3[JJ.Of] with PassTypeArgs {
def instance[U[f[_]]]: U[Jampa] = macro jampa[U]
Expand All @@ -38,10 +37,8 @@ object Jampa extends DerivationKN3[JJ.Of] with PassTypeArgs {
}
}

/** this simple derivation would fail
* if type U would have unbounded type parameters in its definition
* so it's will fail for any type that has more than one parameter
* unless each parameter will have Encoder bound on it
/** this simple derivation would fail if type U would have unbounded type parameters in its definition so it's will fail
* for any type that has more than one parameter unless each parameter will have Encoder bound on it
*/
@delegating("io.circe.derivation.deriveEncoder")
object Cody extends DerivationKN3[JJ.EncoderOpt] with ParamRequire[Encoder] with PassTypeArgs {
Expand Down

0 comments on commit 0b4e6e5

Please sign in to comment.