diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..c8e8740a --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.8.4 +d69567c8dbc4bac0aee9111cdf6b3d776e5d588b diff --git a/.scalafmt.conf b/.scalafmt.conf index 4857afbe..dd50b685 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.8.3" +version = "3.8.4" runner.dialect = scala213 maxColumn = 120 align.preset = more diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/AbstractMacroProcessor.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/AbstractMacroProcessor.scala index e5550635..05ee1378 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/AbstractMacroProcessor.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/AbstractMacroProcessor.scala @@ -107,7 +107,7 @@ abstract class AbstractMacroProcessor(val c: whitebox.Context) { * Return the result of modifyAction function */ def collectCustomExpr( - annottees: Seq[Expr[Any]] + annottees: Seq[Expr[Any]] )(modifyAction: (ClassDef, Option[ModuleDef]) => Any): Expr[Nothing] = { val classDef = checkClassDef(annottees) val compDecl = moduleDef(annottees) @@ -284,10 +284,10 @@ abstract class AbstractMacroProcessor(val c: whitebox.Context) { superClasses.nonEmpty && !superClasses.forall(sc => SDKClasses.contains(sc.toString())) private[internal] final case class ValDefAccessor( - mods: Modifiers, - name: TermName, - tpt: Tree, - rhs: Tree + mods: Modifiers, + name: TermName, + tpt: Tree, + rhs: Tree ) { def typeName: TypeName = symbol.name.toTypeName @@ -363,13 +363,13 @@ abstract class AbstractMacroProcessor(val c: whitebox.Context) { } private[internal] case class ClassDefinition( - self: ValDef, - mods: Modifiers, - className: TypeName, - classParamss: List[List[Tree]], - classTypeParams: List[Tree], - body: List[Tree], - superClasses: List[Tree], - earlydefns: List[Tree] = Nil + self: ValDef, + mods: Modifiers, + className: TypeName, + classParamss: List[List[Tree]], + classTypeParams: List[Tree], + body: List[Tree], + superClasses: List[Tree], + earlydefns: List[Tree] = Nil ) } diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/applyMacro.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/applyMacro.scala index 68b671ae..d0dfe210 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/applyMacro.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/applyMacro.scala @@ -45,9 +45,9 @@ object applyMacro { * B3(int)(j)(k)(t)` */ private def getApplyMethodWithCurrying( - typeName: TypeName, - fieldss: List[List[Tree]], - classTypeParams: List[Tree] + typeName: TypeName, + fieldss: List[List[Tree]], + classTypeParams: List[Tree] ): Tree = { val allFieldsTermName = fieldss.map(f => classParamsTermNameWithType(f)) val returnTypeParams = typeParams(classTypeParams) diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/builderMacro.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/builderMacro.scala index 83f08d49..4d58ac38 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/builderMacro.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/builderMacro.scala @@ -55,10 +55,10 @@ object builderMacro { } private def getBuilderClassAndMethod( - typeName: TypeName, - fieldss: List[List[Tree]], - classTypeParams: List[Tree], - isCase: Boolean + typeName: TypeName, + fieldss: List[List[Tree]], + classTypeParams: List[Tree], + isCase: Boolean ): List[Tree] = { val fields = fieldss.flatten val builderClassName = getBuilderClassName(typeName) diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/constructorMacro.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/constructorMacro.scala index 184affed..77b8acfd 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/constructorMacro.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/constructorMacro.scala @@ -63,8 +63,8 @@ object constructorMacro { /** We generate this method with currying, and we have to deal with the first layer of currying alone. */ private def getThisMethodWithCurrying( - annotteeClassParams: List[List[Tree]], - annotteeClassDefinitions: Seq[Tree] + annotteeClassParams: List[List[Tree]], + annotteeClassDefinitions: Seq[Tree] ): Tree = { val classInternalFieldsWithType = getMemberVarDefTermNameWithType(annotteeClassDefinitions) diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/equalsAndHashCodeMacro.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/equalsAndHashCodeMacro.scala index 2149054f..32e03145 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/equalsAndHashCodeMacro.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/equalsAndHashCodeMacro.scala @@ -65,10 +65,10 @@ object equalsAndHashCodeMacro { // equals method private def getEqualsMethod( - className: TypeName, - termNames: Seq[TermName], - superClasses: Seq[Tree], - annotteeClassDefinitions: Seq[Tree] + className: TypeName, + termNames: Seq[TermName], + superClasses: Seq[Tree], + annotteeClassDefinitions: Seq[Tree] ): List[Tree] = { val existsCanEqual = classMemberDefDefs(annotteeClassDefinitions).exists { case defDef: DefDef if defDef.name.decodedName.toString == "canEqual" && defDef.vparamss.nonEmpty => diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/javaCompatibleMacro.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/javaCompatibleMacro.scala index 6ded892b..7b572111 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/javaCompatibleMacro.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/javaCompatibleMacro.scala @@ -37,8 +37,8 @@ object javaCompatibleMacro { /** We generate this method with currying, and we have to deal with the first layer of currying alone. */ private def getNoArgsContrWithCurrying( - annotteeClassParams: List[List[Tree]], - annotteeClassDefinitions: Seq[Tree] + annotteeClassParams: List[List[Tree]], + annotteeClassDefinitions: Seq[Tree] ): Tree = { annotteeClassDefinitions.foreach { case defDef: DefDef if defDef.name.decodedName.toString == "this" && defDef.vparamss.isEmpty => diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/internal/toStringMacro.scala b/smt-annotations/src/main/scala/org/bitlap/tools/internal/toStringMacro.scala index 6a19f071..5b3739b3 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/internal/toStringMacro.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/internal/toStringMacro.scala @@ -35,9 +35,9 @@ object toStringMacro { import c.universe._ private case class ToStringOptions( - includeInternalFields: Boolean, - includeFieldNames: Boolean, - callSuper: Boolean + includeInternalFields: Boolean, + includeFieldNames: Boolean, + callSuper: Boolean ) private def extractTree(aa: Tree, bb: Tree, cc: Tree): ToStringOptions = @@ -128,7 +128,9 @@ object toStringMacro { } superClassDef.fold(toString) { _ => val superClass = q"${"super="}" - q"override def toString: String = StringContext(${classDefinition.className.toTermName.decodedName.toString} + ${"("} + $superClass, ${if (member.nonEmpty) ", " + q"override def toString: String = StringContext(${classDefinition.className.toTermName.decodedName.toString} + ${"("} + $superClass, ${if ( + member.nonEmpty + ) ", " else ""}+$paramsWithName + ${")"}).s(super.toString)" } } else { diff --git a/smt-annotations/src/main/scala/org/bitlap/tools/toString.scala b/smt-annotations/src/main/scala/org/bitlap/tools/toString.scala index b1f71686..f3acaa82 100644 --- a/smt-annotations/src/main/scala/org/bitlap/tools/toString.scala +++ b/smt-annotations/src/main/scala/org/bitlap/tools/toString.scala @@ -40,9 +40,9 @@ import scala.annotation.{ compileTimeOnly, StaticAnnotation } */ @compileTimeOnly("enable macro to expand macro annotations") final class toString( - includeInternalFields: Boolean = true, - includeFieldNames: Boolean = true, - callSuper: Boolean = false + includeInternalFields: Boolean = true, + includeFieldNames: Boolean = true, + callSuper: Boolean = false ) extends StaticAnnotation { def macroTransform(annottees: Any*): Any = macro toStringMacro.ToStringProcessor.impl } diff --git a/smt-annotations/src/test/scala/org/bitlap/tools/ApplyTest.scala b/smt-annotations/src/test/scala/org/bitlap/tools/ApplyTest.scala index 7ece63e0..c3cb60eb 100644 --- a/smt-annotations/src/test/scala/org/bitlap/tools/ApplyTest.scala +++ b/smt-annotations/src/test/scala/org/bitlap/tools/ApplyTest.scala @@ -65,8 +65,8 @@ class ApplyTest extends AnyFlatSpec with Matchers { @toString class B3(int: Int)(val j: Int)(var k: Option[String] = None)(t: Option[Long] = Some(1L)) @apply @toString class B4(int: Int, a: Seq[Seq[String]])(val j: Int, b: Seq[String])( - var k: Option[String] = None, - c: Seq[Option[String]] + var k: Option[String] = None, + c: Seq[Option[String]] )(t: Option[Long] = Some(1L)) } diff --git a/smt-common/src/main/scala/org/bitlap/common/Transformable.scala b/smt-common/src/main/scala/org/bitlap/common/Transformable.scala index 8bcb8046..2e9b2891 100644 --- a/smt-common/src/main/scala/org/bitlap/common/Transformable.scala +++ b/smt-common/src/main/scala/org/bitlap/common/Transformable.scala @@ -46,8 +46,8 @@ class Transformable[From, To] { */ @unchecked def setType[FromField, ToField]( - selectFromField: From => FromField, - map: FromField => ToField + selectFromField: From => FromField, + map: FromField => ToField ): Transformable[From, To] = macro TransformerMacro.mapTypeImpl[From, To, FromField, ToField] @@ -67,8 +67,8 @@ class Transformable[From, To] { */ @unchecked def setName[FromField, ToField]( - selectFromField: From => FromField, - selectToField: To => ToField + selectFromField: From => FromField, + selectToField: To => ToField ): Transformable[From, To] = macro TransformerMacro.mapNameImpl[From, To, FromField, ToField] diff --git a/smt-common/src/main/scala/org/bitlap/common/internal/AbstractMacroProcessor.scala b/smt-common/src/main/scala/org/bitlap/common/internal/AbstractMacroProcessor.scala index 64463022..dd3bbd90 100644 --- a/smt-common/src/main/scala/org/bitlap/common/internal/AbstractMacroProcessor.scala +++ b/smt-common/src/main/scala/org/bitlap/common/internal/AbstractMacroProcessor.scala @@ -37,11 +37,11 @@ abstract class AbstractMacroProcessor(val c: blackbox.Context) { final case class FieldZipInformation(fieldNames: List[String], fieldIndexTypeMapping: List[(Int, Type)]) final case class CollectionFlags( - isSeq: Boolean = false, - isList: Boolean = false, - isOption: Boolean = false, - isVector: Boolean = false, - isSet: Boolean = false + isSeq: Boolean = false, + isList: Boolean = false, + isOption: Boolean = false, + isVector: Boolean = false, + isSet: Boolean = false ) { def isCollection: Boolean = isSeq || isList || isOption || isVector || isSet @@ -49,21 +49,21 @@ abstract class AbstractMacroProcessor(val c: blackbox.Context) { } final case class FieldTreeInformation( - index: Int, - fieldTerm: Tree, - fieldType: Type, - zeroValue: Tree, - collectionsFlags: CollectionFlags, - genericType: List[Type] = Nil + index: Int, + fieldTerm: Tree, + fieldType: Type, + zeroValue: Tree, + collectionsFlags: CollectionFlags, + genericType: List[Type] = Nil ) final case class FieldInformation( - fieldName: String, - fieldType: Type, - collectionFlags: CollectionFlags, - genericType: List[Type] = Nil, - hasDefaultValue: Boolean, - zeroValue: Tree + fieldName: String, + fieldType: Type, + collectionFlags: CollectionFlags, + genericType: List[Type] = Nil, + hasDefaultValue: Boolean, + zeroValue: Tree ) def tryGetOrElse(tree: Tree, default: Tree): Tree = diff --git a/smt-common/src/main/scala/org/bitlap/common/internal/TransformerMacro.scala b/smt-common/src/main/scala/org/bitlap/common/internal/TransformerMacro.scala index 05798d40..35563b18 100644 --- a/smt-common/src/main/scala/org/bitlap/common/internal/TransformerMacro.scala +++ b/smt-common/src/main/scala/org/bitlap/common/internal/TransformerMacro.scala @@ -41,8 +41,8 @@ class TransformerMacro(override val c: whitebox.Context) extends AbstractMacroPr private val fromTermName = TermName("from") def mapTypeImpl[From, To, FromField, ToField]( - selectFromField: Expr[From => FromField], - map: Expr[FromField => ToField] + selectFromField: Expr[From => FromField], + map: Expr[FromField => ToField] ): Expr[Transformable[From, To]] = { val Function(_, Select(_, fromName)) = selectFromField.tree val builderId = getBuilderId(annoBuilderPrefix) @@ -54,8 +54,8 @@ class TransformerMacro(override val c: whitebox.Context) extends AbstractMacroPr } def setDefaultValueImpl[From, To, ToField]( - selectToField: Expr[To => ToField], - defaultValue: Expr[ToField] + selectToField: Expr[To => ToField], + defaultValue: Expr[ToField] ): Expr[Transformable[From, To]] = { val Function(_, Select(_, toName)) = selectToField.tree val builderId = getBuilderId(annoBuilderPrefix) @@ -67,8 +67,8 @@ class TransformerMacro(override val c: whitebox.Context) extends AbstractMacroPr } def mapNameImpl[From, To, FromField, ToField]( - selectFromField: Expr[From => FromField], - selectToField: Expr[To => ToField] + selectFromField: Expr[From => FromField], + selectToField: Expr[To => ToField] ): Expr[Transformable[From, To]] = { val Function(_, Select(_, fromName)) = selectFromField.tree val Function(_, Select(_, toName)) = selectToField.tree @@ -219,10 +219,10 @@ class TransformerMacro(override val c: whitebox.Context) extends AbstractMacroPr } private def checkForNoMappingField[From: WeakTypeTag, To: WeakTypeTag]( - realFromFieldName: String, - fromFieldOpt: Option[FieldInformation], - toField: FieldInformation, - customFieldNameMapping: mutable.Map[String, String] + realFromFieldName: String, + fromFieldOpt: Option[FieldInformation], + toField: FieldInformation, + customFieldNameMapping: mutable.Map[String, String] ): Tree = { val toClassInfo = caseClassFieldInfos[To]() val fromClassInfo = caseClassFieldInfos[From]() @@ -286,11 +286,11 @@ class TransformerMacro(override val c: whitebox.Context) extends AbstractMacroPr } private def checkMissingFields[From: WeakTypeTag, To: WeakTypeTag]( - fromClassInfo: List[FieldInformation], - toClassInfo: List[FieldInformation], - customDefaultValueMapping: mutable.Map[String, Any], - customFieldNameMapping: mutable.Map[String, String], - customOptionsMapping: mutable.Set[Options] + fromClassInfo: List[FieldInformation], + toClassInfo: List[FieldInformation], + customDefaultValueMapping: mutable.Map[String, Any], + customFieldNameMapping: mutable.Map[String, String], + customOptionsMapping: mutable.Set[Options] ) = { val toClassName = classTypeName[To] val fromClassName = classTypeName[From] diff --git a/smt-common/src/main/scala/org/bitlap/common/jdbc/rows.scala b/smt-common/src/main/scala/org/bitlap/common/jdbc/rows.scala index 14079556..e9853edb 100644 --- a/smt-common/src/main/scala/org/bitlap/common/jdbc/rows.scala +++ b/smt-common/src/main/scala/org/bitlap/common/jdbc/rows.scala @@ -32,347 +32,347 @@ final case class GenericRow3[T1, T2, T3](col1: T1, col2: T2, col3: T3) final case class GenericRow4[T1, T2, T3, T4](col1: T1, col2: T2, col3: T3, col4: T4) extends GenericRow final case class GenericRow5[T1, T2, T3, T4, T5](col1: T1, col2: T2, col3: T3, col4: T4, col5: T5) extends GenericRow final case class GenericRow6[T1, T2, T3, T4, T5, T6]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6 ) extends GenericRow final case class GenericRow7[T1, T2, T3, T4, T5, T6, T7]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7 ) extends GenericRow final case class GenericRow8[T1, T2, T3, T4, T5, T6, T7, T8]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8 ) extends GenericRow final case class GenericRow9[T1, T2, T3, T4, T5, T6, T7, T8, T9]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9 ) extends GenericRow final case class GenericRow10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10 ) extends GenericRow final case class GenericRow11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11 ) extends GenericRow final case class GenericRow12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12 ) extends GenericRow final case class GenericRow13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13 ) extends GenericRow final case class GenericRow14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14 ) extends GenericRow final case class GenericRow15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15 ) extends GenericRow final case class GenericRow16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16 ) extends GenericRow final case class GenericRow17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16, - col17: T17 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16, + col17: T17 ) extends GenericRow final case class GenericRow18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16, - col17: T17, - col18: T18 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16, + col17: T17, + col18: T18 ) extends GenericRow final case class GenericRow19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16, - col17: T17, - col18: T18, - col19: T19 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16, + col17: T17, + col18: T18, + col19: T19 ) extends GenericRow final case class GenericRow20[ - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15, - T16, - T17, - T18, - T19, - T20 + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15, + T16, + T17, + T18, + T19, + T20 ]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16, - col17: T17, - col18: T18, - col19: T19, - col20: T20 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16, + col17: T17, + col18: T18, + col19: T19, + col20: T20 ) extends GenericRow final case class GenericRow21[ - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15, - T16, - T17, - T18, - T19, - T20, - T21 + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15, + T16, + T17, + T18, + T19, + T20, + T21 ]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16, - col17: T17, - col18: T18, - col19: T19, - col20: T20, - col21: T21 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16, + col17: T17, + col18: T18, + col19: T19, + col20: T20, + col21: T21 ) extends GenericRow final case class GenericRow22[ - T1, - T2, - T3, - T4, - T5, - T6, - T7, - T8, - T9, - T10, - T11, - T12, - T13, - T14, - T15, - T16, - T17, - T18, - T19, - T20, - T21, - T22 + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15, + T16, + T17, + T18, + T19, + T20, + T21, + T22 ]( - col1: T1, - col2: T2, - col3: T3, - col4: T4, - col5: T5, - col6: T6, - col7: T7, - col8: T8, - col9: T9, - col10: T10, - col11: T11, - col12: T12, - col13: T13, - col14: T14, - col15: T15, - col16: T16, - col17: T17, - col18: T18, - col19: T19, - col20: T20, - col21: T21, - col22: T22 + col1: T1, + col2: T2, + col3: T3, + col4: T4, + col5: T5, + col6: T6, + col7: T7, + col8: T8, + col9: T9, + col10: T10, + col11: T11, + col12: T12, + col13: T13, + col14: T14, + col15: T15, + col16: T16, + col17: T17, + col18: T18, + col19: T19, + col20: T20, + col21: T21, + col22: T22 ) extends GenericRow diff --git a/smt-common/src/main/scala/org/bitlap/common/package.scala b/smt-common/src/main/scala/org/bitlap/common/package.scala index 7c750c18..ca0fe396 100644 --- a/smt-common/src/main/scala/org/bitlap/common/package.scala +++ b/smt-common/src/main/scala/org/bitlap/common/package.scala @@ -53,7 +53,7 @@ package object common { } implicit final def transformerMap[K, F, T](implicit - e: Transformer[F, T] + e: Transformer[F, T] ): Transformer[Map[K, F], Map[K, T]] = new Transformer[Map[K, F], Map[K, T]] { override def transform(from: Map[K, F]): Map[K, T] = from.map(kv => kv._1 -> e.transform(kv._2)) diff --git a/smt-common/src/test/scala/org/bitlap/common/TestEntity.scala b/smt-common/src/test/scala/org/bitlap/common/TestEntity.scala index 4163c27c..4d20ff13 100644 --- a/smt-common/src/test/scala/org/bitlap/common/TestEntity.scala +++ b/smt-common/src/test/scala/org/bitlap/common/TestEntity.scala @@ -26,8 +26,8 @@ package org.bitlap.common * @version 1.0,6/8/22 */ final case class TestEntity( - name: String, - id: String, - key: String, - value: Option[Int] = None + name: String, + id: String, + key: String, + value: Option[Int] = None ) diff --git a/smt-common/src/test/scala/org/bitlap/common/TransformableTest.scala b/smt-common/src/test/scala/org/bitlap/common/TransformableTest.scala index e27d5e37..ae810a90 100644 --- a/smt-common/src/test/scala/org/bitlap/common/TransformableTest.scala +++ b/smt-common/src/test/scala/org/bitlap/common/TransformableTest.scala @@ -148,22 +148,22 @@ class TransformableTest extends AnyFlatSpec with Matchers { "TransformableTest more complex case for two-layer nest field" should "ok for implicit automatically" in { case class C1(j: Int) case class D1( - a1: List[List[C1]], - b1: Option[C1], - c1: List[Option[C1]], - d1: Option[List[C1]], - map1: Map[String, String], - intMap1: Map[Int, C1] + a1: List[List[C1]], + b1: Option[C1], + c1: List[Option[C1]], + d1: Option[List[C1]], + map1: Map[String, String], + intMap1: Map[Int, C1] ) case class C2(j: Int) case class D2( - a2: List[List[C2]], - b2: Option[C1], - c2: List[Option[C1]], - d2: Option[List[C1]], - map2: Map[String, String], - intMap2: Map[Int, C2] + a2: List[List[C2]], + b2: Option[C1], + c2: List[Option[C1]], + d2: Option[List[C1]], + map2: Map[String, String], + intMap2: Map[Int, C2] ) // NOTE: have collection not support? please implicit val transformer = new Transformer[F, T] { ... } @@ -270,12 +270,12 @@ class TransformableTest extends AnyFlatSpec with Matchers { "TransformableTest assign list to seq" should "ok for implicit automatically" in { case class C1(j: Int) case class D1( - a1: List[C1] + a1: List[C1] ) case class C2(j: Int) case class D2( - a2: Seq[C2] + a2: Seq[C2] ) object C1 { @@ -303,16 +303,16 @@ class TransformableTest extends AnyFlatSpec with Matchers { "TransformableTest support set and vector" should "ok for implicit automatically" in { case class C1(j: Int) case class D1( - a1: Seq[C1], - b1: Set[C1], - c1: Vector[C1] + a1: Seq[C1], + b1: Set[C1], + c1: Vector[C1] ) case class C2(j: Int) case class D2( - a2: List[C2], - b2: Set[C2], - c2: Vector[C2] + a2: List[C2], + b2: Set[C2], + c2: Vector[C2] ) object C1 { @@ -388,14 +388,14 @@ class TransformableTest extends AnyFlatSpec with Matchers { "TransformableTest enable* method" should "ok" in { case class A1(a: String, b: Int, cc: Long) case class A2( - a: String, - b: Int, - c: Int, - d: Option[String], - e: List[String], - f: Seq[String], - g: Set[String], - h: Vector[String] + a: String, + b: Int, + c: Int, + d: Option[String], + e: List[String], + f: Seq[String], + g: Set[String], + h: Vector[String] ) val a = A1("hello", 1, 2) @@ -450,11 +450,11 @@ class TransformableTest extends AnyFlatSpec with Matchers { "TransformableTest disable* method" should "ok" in { case class A1(d: Option[String]) case class A2( - d: Option[String], - e: Option[String] = Some("option"), - f: Option[String] = None, - h: List[String] = List("list"), - i: List[String] = List.empty + d: Option[String], + e: Option[String] = Some("option"), + f: Option[String] = None, + h: List[String] = List("list"), + i: List[String] = List.empty ) val a = A1(Some("hello a")) @@ -478,11 +478,11 @@ class TransformableTest extends AnyFlatSpec with Matchers { "TransformableTest disable* is ok" should "compile ok" in { case class A1(d: Option[String]) case class A2( - d: Option[String], - e: Option[String] = Some("option"), - f: Option[String] = None, - h: List[String] = List("list"), - i: List[String] = List.empty + d: Option[String], + e: Option[String] = Some("option"), + f: Option[String] = None, + h: List[String] = List("list"), + i: List[String] = List.empty ) val a = A1(Some("hello a")) @@ -523,9 +523,9 @@ class TransformableTest extends AnyFlatSpec with Matchers { } case class A2( - b: Option[String], - c: String, - e: Option[String] = Some("option") + b: Option[String], + c: String, + e: Option[String] = Some("option") ) val a = A1(Some("hello a"), false) @@ -545,11 +545,11 @@ class TransformableTest extends AnyFlatSpec with Matchers { } case class A2( - d: Option[String], - e: Option[String] = Some("option"), - f: Option[String] = None, - h: List[String] = List("list"), - i: List[String] = List.empty + d: Option[String], + e: Option[String] = Some("option"), + f: Option[String] = None, + h: List[String] = List("list"), + i: List[String] = List.empty ) val a = A1(Some("hello a"))