From c3d3d59a0e3737c53f99ca6488f093577347ff8d Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 17:17:54 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.11.3 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 8bfe3cb6f..b230cf91f 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.6 +version = 3.11.3 runner.dialect = scala212 From c2592bc54c7b53585daebb39385a7134740200d2 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 17:18:05 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.11.3 Executed command: scalafmt --non-interactive --- .../laika/internal/parse/hocon/FieldRef.scala | 4 +- .../main/scala/laika/parse/SourceCursor.scala | 2 +- .../test/scala/laika/api/ParseAPISpec.scala | 22 +- .../directive/std/ImageDirectiveSpec.scala | 22 +- .../directive/std/SelectDirectiveSpec.scala | 8 +- .../directive/std/StandardDirectiveSpec.scala | 20 +- .../scala/laika/internal/rst/APISpec.scala | 26 +- .../laika/internal/rst/BlockParsersSpec.scala | 14 +- .../rst/std/StandardBlockDirectivesSpec.scala | 16 +- .../rst/std/StandardSpanDirectivesSpec.scala | 22 +- .../rst/std/StandardTextRolesSpec.scala | 2 +- .../laika/markdown/BlockParsersSpec.scala | 30 +- .../laika/markdown/HTMLBlockParserSpec.scala | 14 +- .../parse/code/languages/LanguageSpec.scala | 42 +- .../scala/laika/render/HTMLRendererSpec.scala | 90 +-- .../main/scala/laika/helium/config/api.scala | 2 +- .../laika/helium/HeliumDownloadPageSpec.scala | 96 ++-- .../laika/render/fo/XSLFORendererSpec.scala | 516 +++++++++--------- 18 files changed, 474 insertions(+), 474 deletions(-) diff --git a/core/shared/src/main/scala/laika/internal/parse/hocon/FieldRef.scala b/core/shared/src/main/scala/laika/internal/parse/hocon/FieldRef.scala index ba0b97221..03aa3a284 100644 --- a/core/shared/src/main/scala/laika/internal/parse/hocon/FieldRef.scala +++ b/core/shared/src/main/scala/laika/internal/parse/hocon/FieldRef.scala @@ -407,7 +407,7 @@ private[laika] object FieldRef { name: String, subKey: Key, context: ResolverContext - ): Option[ResolvedRef] = + ): Option[ResolvedRef] = resolve(context).selectChild(name, subKey, context) def withName(name: String): FieldRef = dependent(name, configOrigin, value) } @@ -446,7 +446,7 @@ private[laika] object FieldRef { name: String, subKey: Key, context: ResolverContext - ): Option[ResolvedRef] = + ): Option[ResolvedRef] = resolve(context).selectChild(name, subKey, context) def withName(name: String): FieldRef = substitution(name, configOrigin, substitutionRef, optional) diff --git a/core/shared/src/main/scala/laika/parse/SourceCursor.scala b/core/shared/src/main/scala/laika/parse/SourceCursor.scala index 5fea5a527..96dce8d90 100644 --- a/core/shared/src/main/scala/laika/parse/SourceCursor.scala +++ b/core/shared/src/main/scala/laika/parse/SourceCursor.scala @@ -321,7 +321,7 @@ class BlockSource( @tailrec def posFromLine( remainingLines: List[LineSource], remainingOffset: Int - ): (LineSource, Int) = { + ): (LineSource, Int) = { val lineLength = remainingLines.head.length if (lineLength >= remainingOffset) (remainingLines.head, remainingOffset) else if (remainingLines.tail.isEmpty) (remainingLines.head, lineLength) diff --git a/core/shared/src/test/scala/laika/api/ParseAPISpec.scala b/core/shared/src/test/scala/laika/api/ParseAPISpec.scala index bf1404b3e..950a6d448 100644 --- a/core/shared/src/test/scala/laika/api/ParseAPISpec.scala +++ b/core/shared/src/test/scala/laika/api/ParseAPISpec.scala @@ -71,8 +71,8 @@ class ParseAPISpec extends FunSuite test("parse Markdown into a raw document, without applying the default rewrite rules") { val input = """[link][id] - | - |[id]: http://foo/""".stripMargin + | + |[id]: http://foo/""".stripMargin val parser = MarkupParser.of(Markdown).build assertEquals( parser.parseUnresolved(input).map(_.document.content), @@ -92,15 +92,15 @@ class ParseAPISpec extends FunSuite | |[invalid2]""".stripMargin val msg = """One or more error nodes in result: - | [1]: unresolved link id reference: invalid1 - | - | [invalid1] - | ^ - | - | [5]: unresolved link id reference: invalid2 - | - | [invalid2] - | ^""".stripMargin + | [1]: unresolved link id reference: invalid1 + | + | [invalid1] + | ^ + | + | [5]: unresolved link id reference: invalid2 + | + | [invalid2] + | ^""".stripMargin assertEquals(MarkupParser.of(Markdown).build.parse(input).leftMap(_.message), Left(msg)) } diff --git a/core/shared/src/test/scala/laika/directive/std/ImageDirectiveSpec.scala b/core/shared/src/test/scala/laika/directive/std/ImageDirectiveSpec.scala index c4dece13a..844a3006b 100644 --- a/core/shared/src/test/scala/laika/directive/std/ImageDirectiveSpec.scala +++ b/core/shared/src/test/scala/laika/directive/std/ImageDirectiveSpec.scala @@ -82,9 +82,9 @@ class ImageDirectiveSpec extends FunSuite with ParagraphCompanionShortcuts with test("block directive - intrinsicWidth and intrinsicHeight attributes") { val input = """@:image(picture.jpg) { - | intrinsicWidth = 320 - | intrinsicHeight = 240 - |}""".stripMargin + | intrinsicWidth = 320 + | intrinsicHeight = 240 + |}""".stripMargin val result = Image( resolvedImageTarget, width = Some(LengthUnit.px(320)), @@ -106,9 +106,9 @@ class ImageDirectiveSpec extends FunSuite with ParagraphCompanionShortcuts with test("span directive - alt and title attributes") { val input = """aaa @:image(picture.jpg) { - | alt = alt - | title = desc - |} bbb""".stripMargin + | alt = alt + | title = desc + |} bbb""".stripMargin val result = Image( resolvedImageTarget, alt = Some("alt"), @@ -120,9 +120,9 @@ class ImageDirectiveSpec extends FunSuite with ParagraphCompanionShortcuts with test("span directive - intrinsicWidth and intrinsicHeight attributes") { val input = """aaa @:image(picture.jpg) { - | intrinsicWidth = 320 - | intrinsicHeight = 240 - |} bbb""".stripMargin + | intrinsicWidth = 320 + | intrinsicHeight = 240 + |} bbb""".stripMargin val result = Image( resolvedImageTarget, width = Some(LengthUnit.px(320)), @@ -134,8 +134,8 @@ class ImageDirectiveSpec extends FunSuite with ParagraphCompanionShortcuts with test("span directive - style attribute") { val input = """aaa @:image(picture.jpg) { - | style = small-image - |} bbb""".stripMargin + | style = small-image + |} bbb""".stripMargin val result = Image(resolvedImageTarget, options = Styles("small-image")) runSpans(input, result) } diff --git a/core/shared/src/test/scala/laika/directive/std/SelectDirectiveSpec.scala b/core/shared/src/test/scala/laika/directive/std/SelectDirectiveSpec.scala index e7c9e8bfb..d430319e6 100644 --- a/core/shared/src/test/scala/laika/directive/std/SelectDirectiveSpec.scala +++ b/core/shared/src/test/scala/laika/directive/std/SelectDirectiveSpec.scala @@ -110,10 +110,10 @@ class SelectDirectiveSpec extends FunSuite with ParagraphCompanionShortcuts | |@:@""".stripMargin val input = s"""aa - | - |$directive - | - |bb""".stripMargin + | + |$directive + | + |bb""".stripMargin val message = "One or more errors processing directive 'select': too few occurrences of separator directive 'choice': expected min: 2, actual: 1" val invalid = InvalidBlock(message, source(directive, input, defaultPath)) diff --git a/core/shared/src/test/scala/laika/directive/std/StandardDirectiveSpec.scala b/core/shared/src/test/scala/laika/directive/std/StandardDirectiveSpec.scala index b41cdccf4..6340e251e 100644 --- a/core/shared/src/test/scala/laika/directive/std/StandardDirectiveSpec.scala +++ b/core/shared/src/test/scala/laika/directive/std/StandardDirectiveSpec.scala @@ -78,16 +78,16 @@ class StandardDirectiveSpec extends FunSuite test("fragment directive with two paragraphs") { val input = """aa - | - |@:fragment(foo) - | - |Line 1 - | - |Line 2 - | - |@:@ - | - |bb""".stripMargin + | + |@:fragment(foo) + | + |Line 1 + | + |Line 2 + | + |@:@ + | + |bb""".stripMargin val expectedFragment = BlockSequence(List(p("Line 1"), p("Line 2")), Styles("foo")) runFragment(input, expectedFragment) } diff --git a/core/shared/src/test/scala/laika/internal/rst/APISpec.scala b/core/shared/src/test/scala/laika/internal/rst/APISpec.scala index 9bd4b8409..4b201c1af 100644 --- a/core/shared/src/test/scala/laika/internal/rst/APISpec.scala +++ b/core/shared/src/test/scala/laika/internal/rst/APISpec.scala @@ -39,8 +39,8 @@ class APISpec extends FunSuite with ParagraphCompanionShortcuts with RenderPhase }) ) val input = """.. oneArg:: arg - | - |.. twoArgs:: arg arg""".stripMargin + | + |.. twoArgs:: arg arg""".stripMargin val parser = MarkupParser .of(ReStructuredText) .using(ExtensionProvider.forExtensions(blocks = directives)) @@ -60,10 +60,10 @@ class APISpec extends FunSuite with ParagraphCompanionShortcuts with RenderPhase }) ) val input = """foo |one| foo |two| - | - |.. |one| oneArg:: arg - | - |.. |two| twoArgs:: arg arg""".stripMargin + | + |.. |one| oneArg:: arg + | + |.. |two| twoArgs:: arg arg""".stripMargin val parser = MarkupParser .of(ReStructuredText) .using(ExtensionProvider.forExtensions(spans = directives)) @@ -86,13 +86,13 @@ class APISpec extends FunSuite with ParagraphCompanionShortcuts with RenderPhase }) { (res, text) => Text(res + text) } ) val input = """foo `one`:one: foo :two:`two` - | - |.. role::one(oneArg) - | :name: val - | - |.. role::two(twoArgs) - | :name1: val1 - | :name2: val2""".stripMargin + | + |.. role::one(oneArg) + | :name: val + | + |.. role::two(twoArgs) + | :name1: val1 + | :name2: val2""".stripMargin val parser = MarkupParser .of(ReStructuredText) .using(ExtensionProvider.forExtensions(roles = roles)) diff --git a/core/shared/src/test/scala/laika/internal/rst/BlockParsersSpec.scala b/core/shared/src/test/scala/laika/internal/rst/BlockParsersSpec.scala index 46aa63bac..2f8535b4d 100644 --- a/core/shared/src/test/scala/laika/internal/rst/BlockParsersSpec.scala +++ b/core/shared/src/test/scala/laika/internal/rst/BlockParsersSpec.scala @@ -177,14 +177,14 @@ class BlockParsersSpec extends FunSuite with ParagraphCompanionShortcuts with Te test("headers with varying levels") { val h1 = """========== - | Header 1 - |==========""".stripMargin + | Header 1 + |==========""".stripMargin val h2 = """Header 2 - |========""".stripMargin + |========""".stripMargin val h3 = """Header 3 - |--------""".stripMargin + |--------""".stripMargin val h4 = """Header 2b - |=========""".stripMargin + |=========""".stripMargin val input = s"""$h1 | @@ -228,8 +228,8 @@ class BlockParsersSpec extends FunSuite with ParagraphCompanionShortcuts with Te val header = """Header |======""".stripMargin val input = s""".. _target: - | - |$header""".stripMargin + | + |$header""".stripMargin run( input, DecoratedHeader( diff --git a/core/shared/src/test/scala/laika/internal/rst/std/StandardBlockDirectivesSpec.scala b/core/shared/src/test/scala/laika/internal/rst/std/StandardBlockDirectivesSpec.scala index 0cb84e1d4..c1736fc59 100644 --- a/core/shared/src/test/scala/laika/internal/rst/std/StandardBlockDirectivesSpec.scala +++ b/core/shared/src/test/scala/laika/internal/rst/std/StandardBlockDirectivesSpec.scala @@ -593,10 +593,10 @@ class StandardBlockDirectivesSpec extends FunSuite with ParagraphCompanionShortc test("header - creates a fragment in the document") { val input = """.. header:: - | This is - | a header - | - |This isn't""".stripMargin + | This is + | a header + | + |This isn't""".stripMargin val fragments = Map("header" -> BlockSequence("This is\na header")) val rootElem = RootElement(p("This isn't")) runFragments(input, fragments, rootElem) @@ -604,10 +604,10 @@ class StandardBlockDirectivesSpec extends FunSuite with ParagraphCompanionShortc test("footer - creates a fragment in the document") { val input = """.. footer:: - | This is - | a footer - | - |This isn't""".stripMargin + | This is + | a footer + | + |This isn't""".stripMargin val fragments = Map("footer" -> BlockSequence("This is\na footer")) val rootElem = RootElement(p("This isn't")) runFragments(input, fragments, rootElem) diff --git a/core/shared/src/test/scala/laika/internal/rst/std/StandardSpanDirectivesSpec.scala b/core/shared/src/test/scala/laika/internal/rst/std/StandardSpanDirectivesSpec.scala index f1041c93e..66405c54d 100644 --- a/core/shared/src/test/scala/laika/internal/rst/std/StandardSpanDirectivesSpec.scala +++ b/core/shared/src/test/scala/laika/internal/rst/std/StandardSpanDirectivesSpec.scala @@ -107,10 +107,10 @@ class StandardSpanDirectivesSpec extends FunSuite with ParagraphCompanionShortcu test("image - with width and height options") { val input = """.. |subst| image:: picture.jpg - | :width: 200px - | :height: 120px - | - |Some |subst|""".stripMargin + | :width: 200px + | :height: 120px + | + |Some |subst|""".stripMargin val expectedWidth = Some(LengthUnit.px(200)) val expectedHeight = Some(LengthUnit.px(120)) run(input, p(Text("Some "), Image(imgTarget, width = expectedWidth, height = expectedHeight))) @@ -118,11 +118,11 @@ class StandardSpanDirectivesSpec extends FunSuite with ParagraphCompanionShortcu test("image - with scale option") { val input = """.. |subst| image:: picture.jpg - | :width: 200 px - | :height: 120 px - | :scale: 50% - | - |Some |subst|""".stripMargin + | :width: 200 px + | :height: 120 px + | :scale: 50% + | + |Some |subst|""".stripMargin val expectedWidth = Some(LengthUnit.px(100)) val expectedHeight = Some(LengthUnit.px(60)) run(input, p(Text("Some "), Image(imgTarget, width = expectedWidth, height = expectedHeight))) @@ -163,8 +163,8 @@ class StandardSpanDirectivesSpec extends FunSuite with ParagraphCompanionShortcu val format = "yyyy-MM-dd HH:mm:ss" val input = s""".. |subst| date:: $format - | - |Some |subst|""".stripMargin + | + |Some |subst|""".stripMargin val date = PlatformDateTime.format(PlatformDateTime.now, format).toOption.get val result = stripMinutesAndSeconds(RootElement(p(Text(s"Some $date")))) assertEquals(parse(input).map(stripMinutesAndSeconds), Right(result)) diff --git a/core/shared/src/test/scala/laika/internal/rst/std/StandardTextRolesSpec.scala b/core/shared/src/test/scala/laika/internal/rst/std/StandardTextRolesSpec.scala index 376a4fe27..3e90f0689 100644 --- a/core/shared/src/test/scala/laika/internal/rst/std/StandardTextRolesSpec.scala +++ b/core/shared/src/test/scala/laika/internal/rst/std/StandardTextRolesSpec.scala @@ -169,7 +169,7 @@ class StandardTextRolesSpec extends FunSuite with ParagraphCompanionShortcuts test("raw - disabled by default") { val role = """.. role:: foo(raw) - | :format: AML BML CML""".stripMargin + | :format: AML BML CML""".stripMargin val input = s"""$role | |some :foo:`text`""".stripMargin diff --git a/core/shared/src/test/scala/laika/markdown/BlockParsersSpec.scala b/core/shared/src/test/scala/laika/markdown/BlockParsersSpec.scala index 234c4e403..4ca48819f 100644 --- a/core/shared/src/test/scala/laika/markdown/BlockParsersSpec.scala +++ b/core/shared/src/test/scala/laika/markdown/BlockParsersSpec.scala @@ -116,13 +116,13 @@ class BlockParsersSpec extends FunSuite with ParagraphCompanionShortcuts { test("enum lists - items prefixed by numbers containing multiple paragraphs in a single item") { val input = """1. aaa - | - | bbb - | bbb - | - |2. ccc - | - |3. ddd""".stripMargin + | + | bbb + | bbb + | + |2. ccc + | + |3. ddd""".stripMargin val expected = EnumList( Seq(p("aaa"), p("bbb\nbbb")), Seq(fp("ccc")), @@ -536,10 +536,10 @@ class BlockParsersSpec extends FunSuite with ParagraphCompanionShortcuts { test("code block nested inside a list") { val input = """* aaa - |* bbb - | - | code - |* ccc""".stripMargin + |* bbb + | + | code + |* ccc""".stripMargin val expected = BulletList( Seq(p("aaa")), Seq(p("bbb"), LiteralBlock("code")), @@ -550,10 +550,10 @@ class BlockParsersSpec extends FunSuite with ParagraphCompanionShortcuts { test("blockquote nested inside a list") { val input = """* aaa - |* bbb - | - | >quote - |* ccc""".stripMargin + |* bbb + | + | >quote + |* ccc""".stripMargin val expected = BulletList( Seq(p("aaa")), Seq(p("bbb"), QuotedBlock("quote")), diff --git a/core/shared/src/test/scala/laika/markdown/HTMLBlockParserSpec.scala b/core/shared/src/test/scala/laika/markdown/HTMLBlockParserSpec.scala index 7ed1788da..f1881ba0c 100644 --- a/core/shared/src/test/scala/laika/markdown/HTMLBlockParserSpec.scala +++ b/core/shared/src/test/scala/laika/markdown/HTMLBlockParserSpec.scala @@ -106,13 +106,13 @@ class HTMLBlockParserSpec extends FunSuite test("recognize a script tag as a root element") { val input = """aaa - | - | - | - |bbb""".stripMargin + | + | + | + |bbb""".stripMargin val script = HTMLScriptElement( List( HTMLAttribute("type", List(Text("text/javascript")), Some('"')), diff --git a/core/shared/src/test/scala/laika/parse/code/languages/LanguageSpec.scala b/core/shared/src/test/scala/laika/parse/code/languages/LanguageSpec.scala index bd3260838..a7fe1a707 100644 --- a/core/shared/src/test/scala/laika/parse/code/languages/LanguageSpec.scala +++ b/core/shared/src/test/scala/laika/parse/code/languages/LanguageSpec.scala @@ -1921,27 +1921,27 @@ class LanguageSpec extends FunSuite { test("shell/bash") { val input = """# Doc - | - |```sh - |# this is a comment - |export KEY=value # this is a trailing comment - |echo 'hello world' - | - |echo hello $(whoami) - | - |echo $(( 3+5 )) - | - |echo $FOO $? - | - |for i in ${array[@]}; do - | read -p "" input - | echo "\"${input}\"" - |done - | - |exit - |``` - | - |""".stripMargin + | + |```sh + |# this is a comment + |export KEY=value # this is a trailing comment + |echo 'hello world' + | + |echo hello $(whoami) + | + |echo $(( 3+5 )) + | + |echo $FOO $? + | + |for i in ${array[@]}; do + | read -p "" input + | echo "\"${input}\"" + |done + | + |exit + |``` + | + |""".stripMargin val parsed = parse(input) val expected = result( "sh", diff --git a/core/shared/src/test/scala/laika/render/HTMLRendererSpec.scala b/core/shared/src/test/scala/laika/render/HTMLRendererSpec.scala index 127d10d3c..ff5fb77cc 100644 --- a/core/shared/src/test/scala/laika/render/HTMLRendererSpec.scala +++ b/core/shared/src/test/scala/laika/render/HTMLRendererSpec.scala @@ -415,18 +415,18 @@ class HTMLRendererSpec extends FunSuite with ParagraphCompanionShortcuts with Te caption ) val html = """
| a | - |b | - |
| c | - |d | - |
Line 1
- |Line 2
- | - |Line 1
- |Line 2
""".stripMargin + |Line 1
+ |Line 2
+ | + |Line 1
+ |Line 2
""".stripMargin run(elem, html) } @@ -510,15 +510,15 @@ class HTMLRendererSpec extends FunSuite with ParagraphCompanionShortcuts with Te ) val elem = RootElement(p("aaa"), group, p("bbb")) val html = """aaa
- |label-a
- |common
- |11 - |22
- |label-b
- |common
- |33 - |44
- |bbb
""".stripMargin + |label-a
+ |common
+ |11 + |22
+ |label-b
+ |common
+ |33 + |44
+ |bbb
""".stripMargin run(elem, html) } @@ -532,23 +532,23 @@ class HTMLRendererSpec extends FunSuite with ParagraphCompanionShortcuts with Te ) val elem = RootElement(p("aaa"), group, p("bbb")) val html = """aaa
- |common
- |11 - | 22
- |common
- |33 - | 44
- |bbb
""".stripMargin + |common
+ |11 + | 22
+ |common
+ |33 + | 44
+ |bbb
""".stripMargin run(elem, html) } diff --git a/io/src/main/scala/laika/helium/config/api.scala b/io/src/main/scala/laika/helium/config/api.scala index c1365ca2e..83bd31e1a 100644 --- a/io/src/main/scala/laika/helium/config/api.scala +++ b/io/src/main/scala/laika/helium/config/api.scala @@ -264,7 +264,7 @@ private[helium] trait SingleConfigOps extends CommonConfigOps with ColorOps { ): DocumentMetadata => DocumentMetadata = { meta => value.fold(meta)(f(meta, _)) } - val functions = Seq( + val functions = Seq( populate(title)(_.withTitle(_)), populate(description)(_.withDescription(_)), populate(identifier)(_.withIdentifier(_)), diff --git a/io/src/test/scala/laika/helium/HeliumDownloadPageSpec.scala b/io/src/test/scala/laika/helium/HeliumDownloadPageSpec.scala index 21f8270c8..abdd2a9ef 100644 --- a/io/src/test/scala/laika/helium/HeliumDownloadPageSpec.scala +++ b/io/src/test/scala/laika/helium/HeliumDownloadPageSpec.scala @@ -183,14 +183,14 @@ class HeliumDownloadPageSpec extends CatsEffectSuite with InputBuilder with Resu ) .site.landingPage() val expected = """EPUB & PDF
- |EPUB
- | - |EPUB & PDF
+ |EPUB
+ | + |