Skip to content

Commit 6769dd2

Browse files
committed
Scalafmt update.
1 parent 5dca544 commit 6769dd2

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

xpath-to-xml-scala/.scalafmt.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.9.6"
1+
version = "3.10.0"
22
runner.dialect = Scala213Source3
33
maxColumn = 120
44
align.preset = more
@@ -16,6 +16,7 @@ newlines.alwaysBeforeMultilineDef = false
1616
rewrite.rules = [Imports, RedundantBraces, RedundantParens, SortModifiers]
1717
rewrite.redundantBraces.generalExpressions = false
1818
rewrite.imports.sort = scalastyle
19+
rewrite.imports.selectors = fold
1920
rewrite.imports.groups = [
2021
[".*"],
2122
["javax\\..*", "_root_\\.javax\\..*"],

xpath-to-xml-scala/shared.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies {
3535

3636
spotless {
3737
scala {
38-
scalafmt('3.9.6').configFile('.scalafmt.conf')
38+
scalafmt('3.10.0').configFile('.scalafmt.conf')
3939
licenseHeaderFile rootProject.file('gradle/license.header'), 'package '
4040
}
4141
}

xpath-to-xml-scala/src/main/scala/com/github/simy4/xpath/scala/navigator/ScalaXmlNavigator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class ScalaXmlNavigator(override val root: Root) extends Navigator[ScalaXmlNode]
8686
case a: Attribute =>
8787
val toDelete = a.node
8888
val parentNode = a.parent.node
89-
val newAttr =
89+
val newAttr =
9090
if (toDelete.isPrefixed)
9191
parentNode.attributes.remove(toDelete.getNamespace(parentNode), parentNode, toDelete.key)
9292
else parentNode.attributes.remove(toDelete.key)

xpath-to-xml-scala/src/main/scala/com/github/simy4/xpath/scala/navigator/scalaXmlNodes.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract private[navigator] class AbstractScalaXmlNode protected (val parent: Sc
4242
extends ScalaXmlNode
4343
with Serializable {
4444
@SuppressWarnings(Array("org.wartremover.warts.IsInstanceOf"))
45-
def canEqual(that: Any): Boolean = that.isInstanceOf[ScalaXmlNode]
45+
def canEqual(that: Any): Boolean = that.isInstanceOf[ScalaXmlNode]
4646
override def equals(that: Any): Boolean =
4747
that match {
4848
case n: ScalaXmlNode => n.canEqual(this) && node == n.node
@@ -81,7 +81,7 @@ final class Element private[navigator] (
8181
_node.child.view.zipWithIndex.collect { case (e: Elem, i) => new Element(e, i, this) }
8282
def attributes: Iterable[Attribute] =
8383
_node.attributes.view.collect { case a: XmlAttribute => new Attribute(a, this) }
84-
private[navigator] def node: Elem = _node
84+
private[navigator] def node: Elem = _node
8585
private[navigator] def node_=(elem: Elem): Unit = {
8686
val parentNode = parent.node
8787
parent.node =
@@ -91,7 +91,7 @@ final class Element private[navigator] (
9191
}
9292
@SuppressWarnings(Array("org.wartremover.warts.IsInstanceOf"))
9393
override def canEqual(that: Any): Boolean = that.isInstanceOf[Element]
94-
override def equals(that: Any): Boolean =
94+
override def equals(that: Any): Boolean =
9595
that match {
9696
case e: Element => e.canEqual(this) && index == e.index && super.equals(that)
9797
case _ => false
@@ -117,10 +117,10 @@ final class Attribute private[navigator] (
117117
if (attr.isPrefixed) new QName(attr.getNamespace(parent.node), attr.key, attr.pre)
118118
else new QName(attr.key)
119119
}
120-
def getText: String = _attr.value.text
121-
def elements: Iterable[Element] = Nil
122-
def attributes: Iterable[Attribute] = Nil
123-
private[navigator] def node: XmlAttribute = _attr
120+
def getText: String = _attr.value.text
121+
def elements: Iterable[Element] = Nil
122+
def attributes: Iterable[Attribute] = Nil
123+
private[navigator] def node: XmlAttribute = _attr
124124
private[navigator] def node_=(attr: XmlAttribute): Unit = {
125125
parent.node = parent.node % attr
126126
_attr = attr

xpath-to-xml-scala/src/test/scala/com/github/simy4/xpath/scala/XmlBuilderSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ class XmlBuilderSpec extends AnyFunSpec {
127127
}
128128

129129
describe("should not modify document when XPaths are traversable") {
130-
val xmlProperties = fixtureAccessor.getXmlProperties.asScala
131-
val xml = fixtureAccessor.getPutValueXml
132-
val oldDocument = XML.loadString(xml)
130+
val xmlProperties = fixtureAccessor.getXmlProperties.asScala
131+
val xml = fixtureAccessor.getPutValueXml
132+
val oldDocument = XML.loadString(xml)
133133
val builtDocument1 = xmlProperties.toSeq
134134
.foldRight(Right(Nil): Either[Throwable, List[Effect]]) { (pair, acc) =>
135135
for {

0 commit comments

Comments
 (0)