diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..a13e530 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.8.3 +0f14682a678a17c25441058d1a6894bfefd2f4ea diff --git a/.mill-version b/.mill-version index d61567c..7fd0b1e 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.3 \ No newline at end of file +0.12.4 \ No newline at end of file diff --git a/.scalafmt.conf b/.scalafmt.conf index cd8e6b3..b9ab79b 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.6.1" +version = "3.8.3" runner.dialect = scala3 indent.main = 2 diff --git a/scautable/js/src/jsSpecific.scala b/scautable/js/src/jsSpecific.scala index f7dcb3b..01ce16e 100644 --- a/scautable/js/src/jsSpecific.scala +++ b/scautable/js/src/jsSpecific.scala @@ -2,9 +2,8 @@ package io.github.quafadas.scautable trait PlatformSpecific { - /** - * With scaladoc + /** With scaladoc */ def shouldTotallyAppearInDocs(): Unit = () -} \ No newline at end of file +} diff --git a/scautable/jvm/src/jvmSpecific.scala b/scautable/jvm/src/jvmSpecific.scala index cf846a6..72dc404 100644 --- a/scautable/jvm/src/jvmSpecific.scala +++ b/scautable/jvm/src/jvmSpecific.scala @@ -31,11 +31,12 @@ trait PlatformSpecific { runtime.exec(Array[String](s"""xdg-open $uri]""")) } - /** - * Attempts to open a browser window, and display this Seq of `Product` as a table. + /** Attempts to open a browser window, and display this Seq of `Product` as a table. * - * @param a - seq of case classes - * @param tableDeriveInstance - summon a HtmlTableRender instance for the case class + * @param a + * \- seq of case classes + * @param tableDeriveInstance + * \- summon a HtmlTableRender instance for the case class * @return */ def desktopShow[A <: Product](a: Seq[A])(using tableDeriveInstance: HtmlTableRender[A]) = { @@ -70,4 +71,4 @@ $$(document).ready( function () { // val asString = scautable(a).toString() // kernel.publish.html(asString) -} \ No newline at end of file +} diff --git a/scautable/src/package.scala b/scautable/src/package.scala index f145615..fc19ff2 100644 --- a/scautable/src/package.scala +++ b/scautable/src/package.scala @@ -309,40 +309,40 @@ object scautable extends PlatformSpecific { tr(elemLabels.map(th(_))) protected inline def deriveCaseClass[A](using m: Mirror.ProductOf[A]) = - new HtmlTableRender[A] { - - override def tableHeader(a: A) = - val elemLabels = getElemLabels[m.MirroredElemLabels] - tr(elemLabels.map(th(_))) - - override def tableCell(a: A) = ??? - - override def tableRow(a: A) = { - val elemLabels = getElemLabels[m.MirroredElemLabels] - val elemInstances = getTypeclassInstances[m.MirroredElemTypes] - val elems = - a.asInstanceOf[Product].productIterator // every case class implements scala.Product, we can safely cast here - val elemCells = elems - .zip(elemInstances) - .map { (elem, instance) => - instance.tableCell(elem) - } - .toList - tr( - elemCells - ) - } + new HtmlTableRender[A] { + + override def tableHeader(a: A) = + val elemLabels = getElemLabels[m.MirroredElemLabels] + tr(elemLabels.map(th(_))) + + override def tableCell(a: A) = ??? + + override def tableRow(a: A) = { + val elemLabels = getElemLabels[m.MirroredElemLabels] + val elemInstances = getTypeclassInstances[m.MirroredElemTypes] + val elems = + a.asInstanceOf[Product].productIterator // every case class implements scala.Product, we can safely cast here + val elemCells = elems + .zip(elemInstances) + .map { (elem, instance) => + instance.tableCell(elem) + } + .toList + tr( + elemCells + ) } + } - /** Render a sequence of unknown type as an html table - * - * @param a - * \- A sequence of unknown type you wish to render as an html table - * @param addHeader - * \- If true, add a header row to the table - * @param tableDeriveInstance - * \- An instance of HtmlTableRender for the type `A` - */ + /** Render a sequence of unknown type as an html table + * + * @param a + * \- A sequence of unknown type you wish to render as an html table + * @param addHeader + * \- If true, add a header row to the table + * @param tableDeriveInstance + * \- An instance of HtmlTableRender for the type `A` + */ def apply[A <: Product](a: Seq[A], addHeader: Boolean = true)(using tableDeriveInstance: HtmlTableRender[A]): TypedTag[String] = val h = a.head.productElementNames.toList val header = tr(h.map(th(_)))