Skip to content

Commit 0f14682

Browse files
committed
Reformat with scalafmt 3.8.3
Executed command: scalafmt --non-interactive
1 parent 1b97317 commit 0f14682

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

scautable/js/src/jsSpecific.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package io.github.quafadas.scautable
22

33
trait PlatformSpecific {
44

5-
/**
6-
* With scaladoc
5+
/** With scaladoc
76
*/
87
def shouldTotallyAppearInDocs(): Unit = ()
98

10-
}
9+
}

scautable/jvm/src/jvmSpecific.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ trait PlatformSpecific {
3131
runtime.exec(Array[String](s"""xdg-open $uri]"""))
3232
}
3333

34-
/**
35-
* Attempts to open a browser window, and display this Seq of `Product` as a table.
34+
/** Attempts to open a browser window, and display this Seq of `Product` as a table.
3635
*
37-
* @param a - seq of case classes
38-
* @param tableDeriveInstance - summon a HtmlTableRender instance for the case class
36+
* @param a
37+
* \- seq of case classes
38+
* @param tableDeriveInstance
39+
* \- summon a HtmlTableRender instance for the case class
3940
* @return
4041
*/
4142
def desktopShow[A <: Product](a: Seq[A])(using tableDeriveInstance: HtmlTableRender[A]) = {
@@ -70,4 +71,4 @@ $$(document).ready( function () {
7071
// val asString = scautable(a).toString()
7172
// kernel.publish.html(asString)
7273

73-
}
74+
}

scautable/src/package.scala

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -309,40 +309,40 @@ object scautable extends PlatformSpecific {
309309
tr(elemLabels.map(th(_)))
310310

311311
protected inline def deriveCaseClass[A](using m: Mirror.ProductOf[A]) =
312-
new HtmlTableRender[A] {
313-
314-
override def tableHeader(a: A) =
315-
val elemLabels = getElemLabels[m.MirroredElemLabels]
316-
tr(elemLabels.map(th(_)))
317-
318-
override def tableCell(a: A) = ???
319-
320-
override def tableRow(a: A) = {
321-
val elemLabels = getElemLabels[m.MirroredElemLabels]
322-
val elemInstances = getTypeclassInstances[m.MirroredElemTypes]
323-
val elems =
324-
a.asInstanceOf[Product].productIterator // every case class implements scala.Product, we can safely cast here
325-
val elemCells = elems
326-
.zip(elemInstances)
327-
.map { (elem, instance) =>
328-
instance.tableCell(elem)
329-
}
330-
.toList
331-
tr(
332-
elemCells
333-
)
334-
}
312+
new HtmlTableRender[A] {
313+
314+
override def tableHeader(a: A) =
315+
val elemLabels = getElemLabels[m.MirroredElemLabels]
316+
tr(elemLabels.map(th(_)))
317+
318+
override def tableCell(a: A) = ???
319+
320+
override def tableRow(a: A) = {
321+
val elemLabels = getElemLabels[m.MirroredElemLabels]
322+
val elemInstances = getTypeclassInstances[m.MirroredElemTypes]
323+
val elems =
324+
a.asInstanceOf[Product].productIterator // every case class implements scala.Product, we can safely cast here
325+
val elemCells = elems
326+
.zip(elemInstances)
327+
.map { (elem, instance) =>
328+
instance.tableCell(elem)
329+
}
330+
.toList
331+
tr(
332+
elemCells
333+
)
335334
}
335+
}
336336

337-
/** Render a sequence of unknown type as an html table
338-
*
339-
* @param a
340-
* \- A sequence of unknown type you wish to render as an html table
341-
* @param addHeader
342-
* \- If true, add a header row to the table
343-
* @param tableDeriveInstance
344-
* \- An instance of HtmlTableRender for the type `A`
345-
*/
337+
/** Render a sequence of unknown type as an html table
338+
*
339+
* @param a
340+
* \- A sequence of unknown type you wish to render as an html table
341+
* @param addHeader
342+
* \- If true, add a header row to the table
343+
* @param tableDeriveInstance
344+
* \- An instance of HtmlTableRender for the type `A`
345+
*/
346346
def apply[A <: Product](a: Seq[A], addHeader: Boolean = true)(using tableDeriveInstance: HtmlTableRender[A]): TypedTag[String] =
347347
val h = a.head.productElementNames.toList
348348
val header = tr(h.map(th(_)))

0 commit comments

Comments
 (0)