Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.8.6 #689

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ ed6ca75be5fe45cda373a6e2f79105a76fed603d

# Scala Steward: Reformat with scalafmt 3.8.3
e2f5f00ad433f25a24fde3f01927f711deb2442c

# Scala Steward: Reformat with scalafmt 3.8.6
8d82687a7f194fb1e690be3b199d07bc2fc30bf6
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.8.3
version = 3.8.6

runner.dialect = scala212

Expand Down
12 changes: 9 additions & 3 deletions core/shared/src/main/scala/laika/api/bundle/directives.scala
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ trait DirectiveBuilderContext[E <: Element] {
acc :+ nextSeparator
.left.map(errs =>
Seq(
s"One or more errors processing separator directive '$name': ${errs.mkString(", ")}"
s"One or more errors processing separator directive '$name': ${
errs.mkString(", ")
}"
)
)
)
Expand All @@ -434,12 +436,16 @@ trait DirectiveBuilderContext[E <: Element] {
val cnt = nameCounts(dir.name)
(if (cnt > dir.max)
Seq(
s"too many occurrences of separator directive '${dir.name}': expected max: ${dir.max}, actual: $cnt"
s"too many occurrences of separator directive '${
dir.name
}': expected max: ${dir.max}, actual: $cnt"
)
else Nil) ++
(if (cnt < dir.min)
Seq(
s"too few occurrences of separator directive '${dir.name}': expected min: ${dir.min}, actual: $cnt"
s"too few occurrences of separator directive '${
dir.name
}': expected min: ${dir.min}, actual: $cnt"
)
else Nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ object ConfigDecoder {
if (errors.nonEmpty)
Left(
DecodingFailed(
s"One or more errors decoding array elements: ${errors.map(_.message).mkString(", ")}"
s"One or more errors decoding array elements: ${
errors.map(_.message).mkString(", ")
}"
)
)
else Right(results)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ abstract class TagFormatter extends Formatter {
container: ElementContainer[_ <: Element],
attrs: (String, String)*
): String =
s"<$tagName${attributes(tagName, container, attrs)}>${indentedChildren(container.content)}$newLine</$tagName>"
s"<$tagName${attributes(tagName, container, attrs)}>${
indentedChildren(container.content)
}$newLine</$tagName>"

/** Renders an element with the specified tag name, attributes derived from the style hint
* and content based on the provided string that is interpreted as already rendered in the target format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ private[laika] object StandardLinkDirectives {
linkConfig(cursor)
.flatMap { linkConfig =>
val matching =
linkConfig.apiLinks.toList.filter(l => linkId.startsWith(l.packagePrefix)).maximumByOption(
linkConfig.apiLinks.toList.filter(l =>
linkId.startsWith(l.packagePrefix)
).maximumByOption(
_.packagePrefix.length
)
matching.orElse(linkConfig.apiLinks.find(_.packagePrefix == "*")).fold[Either[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ private[laika] class LinkValidator(
if (missingFormats.isEmpty) ValidTarget
else
attemptRecovery(
s"$invalidRefMsg that does not support some of the formats of this document (${missingFormats.mkString(", ")})",
s"$invalidRefMsg that does not support some of the formats of this document (${
missingFormats.mkString(", ")
})",
targetFormats
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ private[laika] object FOFormatter extends (Formatter.Context[TagFormatter] => Ta
content: Seq[Element],
attrs: (String, String)*
): String =
s"<$tagName${fmt.attributes(tagName, styleHint, attrs)}>${fmt.indentedChildren(content)}${fmt.newLine}</$tagName>"
s"<$tagName${fmt.attributes(tagName, styleHint, attrs)}>${fmt.indentedChildren(content)}${
fmt.newLine
}</$tagName>"

/** Renders an element with the specified tag name, attributes derived from the style hint
* and content based on the provided string that is interpreted as already rendered in the target format.
Expand Down
12 changes: 9 additions & 3 deletions io/src/main/scala/laika/helium/internal/generate/FOStyles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ private[laika] class FOStyles(helium: Helium) {
|}
|
|CodeBlock .identifier {
| color: ${colors.syntaxHighlighting.base.c4.displayValue};
| color: ${
colors.syntaxHighlighting.base.c4.displayValue
};
|}
|
|CodeBlock .substitution, CodeBlock .annotation, CodeBlock .markup-emphasized, CodeBlock .xml-processing-instruction {
Expand All @@ -313,11 +315,15 @@ private[laika] class FOStyles(helium: Helium) {
|}
|
|CodeBlock .attribute-name, CodeBlock .declaration-name, CodeBlock .markup-link-target {
| color: ${colors.syntaxHighlighting.wheel.c3.displayValue};
| color: ${
colors.syntaxHighlighting.wheel.c3.displayValue
};
|}
|
|CodeBlock .number-literal, CodeBlock .string-literal, CodeBlock .char-literal, CodeBlock .boolean-literal, CodeBlock .regex-literal, CodeBlock .symbol-literal, CodeBlock .literal-value, CodeBlock .markup-link-text {
| color: ${colors.syntaxHighlighting.wheel.c4.displayValue};
| color: ${
colors.syntaxHighlighting.wheel.c4.displayValue
};
|}
|
|CodeBlock .type-name, CodeBlock .tag-name, CodeBlock .xml-dtd-tag-name, CodeBlock .markup-fence {
Expand Down
4 changes: 3 additions & 1 deletion io/src/main/scala/laika/io/internal/errors/errors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ private[laika] case class ConfigException(error: ConfigError) extends RuntimeExc

private[laika] case class NoMatchingParser(path: Path, suffixes: Set[String])
extends RuntimeException(
s"No matching parser available for path: $path - supported suffixes: ${suffixes.mkString(",")}"
s"No matching parser available for path: $path - supported suffixes: ${
suffixes.mkString(",")
}"
)

private[laika] case class DuplicatePath(path: Path, filePaths: Set[String] = Set.empty)
Expand Down
4 changes: 3 additions & 1 deletion pdf/src/test/scala/laika/render/PDFNavigationSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ class PDFNavigationSpec extends CatsEffectSuite with FileIO with PDFTreeModel {
def result(num: Int): String = {
s"""
|
|<fo:block id="${idPrefix(num)}_doc-$num" page-break-before="always">
|<fo:block id="${
idPrefix(num)
}_doc-$num" page-break-before="always">
| <fo:marker marker-class-name="chapter"><fo:block>Title $num &amp; More</fo:block></fo:marker>
|</fo:block>
|<fo:block id="${idPrefix(num)}_doc-${
Expand Down
4 changes: 3 additions & 1 deletion sbt/src/main/scala/laika/sbt/Logs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ private[sbt] object Logs {
val styles = docTypes.count(_.isInstanceOf[StyleSheet])
val conf = docTypes.count(_ == Config)

s"Parsing $docs markup document${s(docs)}, $tmpl template${s(tmpl)}, $conf configuration${s(conf)}, $styles stylesheet${s(styles)} ..."
s"Parsing $docs markup document${s(docs)}, $tmpl template${s(tmpl)}, $conf configuration${
s(conf)
}, $styles stylesheet${s(styles)} ..."
}

/** Create a string containing detailed information about
Expand Down
8 changes: 6 additions & 2 deletions sbt/src/main/scala/laika/sbt/Tasks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ object Tasks {
val invalid = formats.diff(supportedFormats)
if (invalid.nonEmpty)
throw new IllegalArgumentException(
s"Unsupported formats ${invalid.mkString(", ")} - supported are ${supportedFormats.mkString(", ")}"
s"Unsupported formats ${
invalid.mkString(", ")
} - supported are ${supportedFormats.mkString(", ")}"
)

val configs = formats.map(aliasMap.apply).map(configMap.apply)
Expand Down Expand Up @@ -295,7 +297,9 @@ object Tasks {
val (_, cancel) = buildPreviewServer.value.allocated.unsafeRunSync()

streams.value.log.info(
s"Preview server started at http://${laikaPreviewConfig.value.host}:${laikaPreviewConfig.value.port}. Press return/enter to exit."
s"Preview server started at http://${laikaPreviewConfig.value.host}:${
laikaPreviewConfig.value.port
}. Press return/enter to exit."
)

try {
Expand Down