Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.0.0 #305

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ binPack.parentConstructors = true
maxColumn = 120
includeCurlyBraceInSelectChains = false
align.preset = most
version = "2.7.5"
version = "3.0.0"
trailingCommas = preserve
newlines.penalizeSingleSelectMultiArgList = false
newlines.alwaysBeforeMultilineDef = false
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("adopt@1.8", "adopt@1.11")
ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8", "adopt@1.11")

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",
"odomontois@gmail.com",
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:git@github.com: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