diff --git a/.scalafmt.conf b/.scalafmt.conf index 461b0916..a29c54c5 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -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 \ No newline at end of file diff --git a/build.sbt b/build.sbt index 1ef18a51..dbb263f4 100644 --- a/build.sbt +++ b/build.sbt @@ -20,7 +20,7 @@ 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"), ) @@ -28,8 +28,8 @@ lazy val commonSettings = Seq( 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 diff --git a/ci-release.sbt b/ci-release.sbt index 9aa13f02..9a5240ca 100644 --- a/ci-release.sbt +++ b/ci-release.sbt @@ -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 ) @@ -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"), @@ -29,10 +29,10 @@ 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", @@ -40,9 +40,9 @@ ThisBuild / developers := List( 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" diff --git a/modules/circe/src/main/scala/derevo/circe/circe.scala b/modules/circe/src/main/scala/derevo/circe/circe.scala index b658de30..4c338e32 100644 --- a/modules/circe/src/main/scala/derevo/circe/circe.scala +++ b/modules/circe/src/main/scala/derevo/circe/circe.scala @@ -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]] @@ -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]] @@ -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]] diff --git a/modules/core/src/main/scala/derevo/package.scala b/modules/core/src/main/scala/derevo/package.scala index 436a492b..b14006f2 100644 --- a/modules/core/src/main/scala/derevo/package.scala +++ b/modules/core/src/main/scala/derevo/package.scala @@ -5,8 +5,7 @@ package derevo { def macroTransform(annottees: Any*): Any = macro Derevo.deriveMacro } - /** - */ + /** */ trait PassTypeArgs trait KeepRefinements diff --git a/modules/tests/src/main/scala/derevo/tests/Jampa.scala b/modules/tests/src/main/scala/derevo/tests/Jampa.scala index ea34c92a..ecf11af3 100644 --- a/modules/tests/src/main/scala/derevo/tests/Jampa.scala +++ b/modules/tests/src/main/scala/derevo/tests/Jampa.scala @@ -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] @@ -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 {