Skip to content

Commit 4c6593b

Browse files
authored
java friendly api (#323)
also upgrade scalafmt
1 parent 2bdf7ea commit 4c6593b

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.7.12
1+
version = 3.9.6
22
runner.dialect = scala3
33
preset = IntelliJ
44
maxColumn = 140

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ val scala2_12 = "2.12.20"
77
val osLibVersion = "0.11.4"
88
val commonsTextVersion = "1.13.0"
99
val slf4jVersion = "2.0.17"
10-
val scalafmtVersion = "3.9.4"
10+
val scalafmtVersion = "3.9.6"
1111

1212
/** Only the below listed projects are included in things like `sbt compile`.
1313
* We explicitly want to exclude `benchmarks` which requires qwiet.ai / shiftleft

core/src/main/scala/flatgraph/DiffGraphApplier.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ object DiffGraphApplier {
2727
if (graph.isClosed) throw new GraphClosedException(s"graph cannot be modified any longer since it's closed")
2828
new DiffGraphApplier(graph, diff, schemaViolationReporter, requestedExecutor).applyUpdate()
2929
}
30+
31+
/** java friendly api without the defaults */
32+
def applyDiff(graph: Graph, diff: DiffGraphBuilder): Int =
33+
applyDiff(graph, diff, new SchemaViolationReporter, None)
3034
}
3135

3236
abstract class NewNodePropertyInsertionHelper {

domain-classes-generator/src/main/scala/flatgraph/codegen/Formatter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object Formatter {
1717
}
1818

1919
def run(sourceFiles: Seq[Path], scalafmtConfig: Option[Path]): Unit = {
20-
// println(s"invoking scalafmt on ${sourceFiles.size} files")
20+
println(s"invoking scalafmt on ${sourceFiles.size} files")
2121
val configFile: Path =
2222
scalafmtConfig.getOrElse(os.temp(contents = defaultScalafmtConfig, prefix = "flatgraph-scalafmt", suffix = ".conf").toNIO)
2323

formats/src/main/scala/flatgraph/formats/neo4jcsv/Neo4jCsvImporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ object Neo4jCsvImporter extends Importer {
265265
}
266266

267267
private def parseArrayProperty(rawValue: String, name: String, valueType: ColumnType.Value): Option[ParsedProperty] = {
268-
val values = rawValue.split(';') // from the docs: "By default, array values are separated by ;"
268+
val values = rawValue.split(';') // from the docs: "By default, array values are separated by ;"
269269
if (values.nonEmpty && values.head != "") { // csv parser always adds one empty string entry...
270270
val parsedValues = values.map(parsePropertyValue(_, valueType))
271271
Some(ParsedProperty(name, parsedValues))

odb-convert/src/main/scala/flatgraph/convert/Convert.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ object Convert {
112112
}
113113
}
114114
def pad(): Unit = {
115-
for (qq <- quantities.valuesIterator) { while (qq.length < nextId) qq.addOne(0) }
115+
for (qq <- quantities.valuesIterator) { while (qq.length < nextId) qq.addOne(0) }
116116
for (((prefix, key), v) <- values.iterator if prefix.endsWith(NodeStuff.EDGEPROPERTY_SUFFIX)) {
117117
val stripped =
118118
if (prefix == NodeStuff.NEIGHBOR_IN + NodeStuff.EDGEPROPERTY_SUFFIX) NodeStuff.NEIGHBOR_IN else NodeStuff.NEIGHBOR_OUT

0 commit comments

Comments
 (0)