Skip to content

Commit

Permalink
Reformat with scalafmt 3.8.2
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
typelevel-steward[bot] committed Jun 14, 2024
1 parent 2ce67e9 commit ed6ca75
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class MarkdownToHTMLSpec extends FunSuite {
fmt.indentedElement("blockquote", qb)
case (fmt, h @ Header(_, _, Id(_))) =>
fmt.child(h.clearOptions) // Markdown classic does not generate header ids
case (fmt, t @ Title(_, Id("unordered"))) => fmt.child(Header(2, t.content))
case (fmt, t @ Title(_, Id(_))) => fmt.child(t.clearOptions)
case (fmt, t @ Title(_, Id("unordered"))) => fmt.child(Header(2, t.content))
case (fmt, t @ Title(_, Id(_))) => fmt.child(t.clearOptions)
}
.withMessageFilters(
MessageFilters.custom(failOn = MessageFilter.None, render = MessageFilter.None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ReStructuredTextToHTMLSpec extends FunSuite {
fmt.childPerLine(
Seq(it, Header(level, rest, opt))
) // move target out of the header content
case (fmt, h: Header) =>
case (fmt, h: Header) =>
fmt.element("h" + (h.level - 1), h.clearOptions) // rst special treatment of first header
case (fmt, t: Title) => fmt.element("h1", t.clearOptions, "class" -> "title")
case (fmt, TitledBlock(title, content, opt)) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ private[laika] object StandardLinkDirectives {
lazy val api: LinkDirectives.Directive = LinkDirectives.eval("api") { (linkId, cursor) =>
linkConfig(cursor)
.flatMap { linkConfig =>
val matching = linkConfig.apiLinks.toList.filter(l =>
linkId.startsWith(l.packagePrefix)
).maximumByOption(_.packagePrefix.length)
val matching =
linkConfig.apiLinks.toList.filter(l => linkId.startsWith(l.packagePrefix)).maximumByOption(
_.packagePrefix.length
)
matching.orElse(linkConfig.apiLinks.find(_.packagePrefix == "*")).fold[Either[
String,
SpanLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private[link] class DocumentTargets(document: Document, slugBuilder: String => S

case f: FootnoteDefinition =>
val (docId, displayId, selector) = f.label match {
case FootnoteLabel.Autosymbol =>
case FootnoteLabel.Autosymbol =>
(
s"__fns-${symbolNumbers.next()}",
symbols.next(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private[laika] class LinkValidator(
case TargetFormats.None => InvalidTarget(s"$invalidRefMsg as it is excluded from rendering")
case TargetFormats.Selected(selectedFormats) =>
(cursor.target.targetFormats, outputFormat) match {
case (TargetFormats.None, _) =>
case (TargetFormats.None, _) =>
ValidTarget // to be validated at point of inclusion by a directive like @:include
case (_, Some(output)) if selectedFormats.contains(output) => ValidTarget
case (_, Some(output)) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ private[laika] object ConfigResolver {
}

def resolveValue(key: Key)(value: ConfigBuilderValue): Option[ConfigValue] = value match {
case o: ObjectBuilderValue => Some(resolveObject(o, key))
case a: ArrayBuilderValue =>
case o: ObjectBuilderValue => Some(resolveObject(o, key))
case a: ArrayBuilderValue =>
Some(ArrayValue(a.values.flatMap(resolveValue(key)))) // TODO - adjust path?
case r: ResolvedBuilderValue => Some(r.value)
case s: ValidStringValue => Some(StringValue(s.value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ private[laika] class HTMLRenderer(format: String)
case s: Length => (None, Some(s"$styleName:${s.displayValue}"))
}
.getOrElse((None, None))
val (widthAttr, wStyle) = sizeAttr(width, "width")
val (widthAttr, wStyle) = sizeAttr(width, "width")
val (heightAttr, hStyle) = sizeAttr(height, "height")
val styleAttr = (wStyle ++ hStyle).reduceLeftOption((a, b) => s"$a;$b")
val allAttr = fmt.optAttributes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private[laika] object BlockParsers {
elems += paragraph
parse(parser, rest)
case Success(x, rest) => elems += x; parse(defaultBlock, rest)
case _ => Success(elems.toList, in)
case _ => Success(elems.toList, in)
}

parse(defaultBlock, in)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private[laika] object LinkTargetProcessor extends (Seq[Block] => Seq[Block]) {
case (buffer, InternalLinkTarget(Id(id)) :: elem :: _ :: Nil) if !elem.hasId =>
buffer += elem.withId(id)

case (buffer, _ :: _ :: Nil) =>
case (buffer, _ :: _ :: Nil) =>
buffer // only happens for empty results (with just the 2 mocks)
case (buffer, _ :: other :: _) => buffer += other
case (buffer, _) => buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private[helium] object DownloadPageGenerator {
val blocks = Title(pageConfig.title).withOptions(Style.title) +: pageConfig.description.map(
Paragraph(_)
).toSeq ++: downloads
val doc = Document(Root / "downloads.gen", RootElement(blocks))
val doc = Document(Root / "downloads.gen", RootElement(blocks))
.modifyConfig(_.withValue("helium.markupEditLinks", false))
tree.modifyTree(_.prependContent(doc))
}
Expand Down
2 changes: 1 addition & 1 deletion io/src/test/scala/laika/io/TreeParserSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ class TreeParserSpec
Root / "main2.template.html" -> Contents.directive
)
val template = TemplateRoot(TemplateString("aa "), TemplateString("bar"), TemplateString(" bb"))
val result = Seq(template, template)
val result = Seq(template, template)
parsedTemplates(inputs, BundleProvider.forTemplateDirective(directive)).assertEquals(result)
}

Expand Down
8 changes: 4 additions & 4 deletions io/src/test/scala/laika/render/fo/XSLFORendererSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -686,17 +686,17 @@ class XSLFORendererSpec extends FunSuite with ParagraphCompanionShortcuts with T
val title = SpanSequence("Title " + titleNum)
NavigationItem(title, children, target, options = Style.level(level))
}
val navList = NavigationList(
val navList = NavigationList(
Seq(
link(1, 2, Seq(link(2, 3))),
link(1, 4, Seq(link(2, 5)))
)
)
val level1Props =
val level1Props =
"""color="#931813" font-family="serif" font-size="22pt" font-weight="bold" keep-with-next="always" line-height="1.5" margin-left="0mm" space-after="0mm" space-before="15mm" text-align="justify" text-align-last="center" text-transform="uppercase""""
val level2Props =
val level2Props =
"""color="#931813" font-family="serif" font-size="17pt" keep-with-previous="always" line-height="1.5" margin-left="4mm" space-after="0mm" space-before="7mm" text-align="justify" text-align-last="justify""""
val leader =
val leader =
"""<fo:leader leader-pattern="dots" padding-left="2mm" padding-right="2mm"></fo:leader>"""

val fo =
Expand Down

0 comments on commit ed6ca75

Please sign in to comment.