Skip to content

Commit db86676

Browse files
scala-stewardmichaelmior
authored andcommitted
Reformat with scalafmt 3.8.3
Executed command: scalafmt --non-interactive
1 parent 90c19a6 commit db86676

File tree

3 files changed

+99
-86
lines changed

3 files changed

+99
-86
lines changed

build.sbt

Lines changed: 71 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import Dependencies._
22
import com.typesafe.sbt.packager.docker._
33
import xerial.sbt.Sonatype._
44

5-
ThisBuild / scalaVersion := "2.13.14"
6-
ThisBuild / versionScheme := Some("early-semver")
7-
ThisBuild / organization := "io.github.dataunitylab"
8-
ThisBuild / organizationName := "Rochester Institute of Technology"
5+
ThisBuild / scalaVersion := "2.13.14"
6+
ThisBuild / versionScheme := Some("early-semver")
7+
ThisBuild / organization := "io.github.dataunitylab"
8+
ThisBuild / organizationName := "Rochester Institute of Technology"
99

1010
inThisBuild(
1111
List(
@@ -20,11 +20,13 @@ inThisBuild(
2020
url("https://michael.mior.ca")
2121
)
2222
),
23-
sonatypeProjectHosting := Some(GitHubHosting(
24-
"dataunitylab",
25-
"jsonoid-discovery",
26-
27-
)),
23+
sonatypeProjectHosting := Some(
24+
GitHubHosting(
25+
"dataunitylab",
26+
"jsonoid-discovery",
27+
28+
)
29+
),
2830
semanticdbEnabled := true,
2931
semanticdbVersion := scalafixSemanticdb.revision
3032
)
@@ -43,10 +45,11 @@ val nonConsoleCompilerOptions = Seq(
4345
"-Ywarn-unused:imports",
4446
"-deprecation",
4547
"-release:8"
46-
) ++ {if (sys.env.get("DISABLE_ASSERTIONS").isDefined)
47-
Seq("-Xdisable-assertions")
48-
else
49-
Nil
48+
) ++ {
49+
if (sys.env.get("DISABLE_ASSERTIONS").isDefined)
50+
Seq("-Xdisable-assertions")
51+
else
52+
Nil
5053
}
5154

5255
val generateSchemas = taskKey[Unit]("Generate example schemas")
@@ -74,63 +77,64 @@ generateSchemas := {
7477
)
7578

7679
for (input <- inputs) {
77-
r.run("io.github.dataunitylab.jsonoid.discovery.DiscoverSchema",
78-
data(cp),
79-
Seq(
80-
"src/test/resources/" + input,
81-
"-p",
82-
"Simple",
83-
"-w",
84-
schemaPath.resolve(input).toString
85-
),
86-
(streams.value: @sbtUnchecked).log)
80+
r.run(
81+
"io.github.dataunitylab.jsonoid.discovery.DiscoverSchema",
82+
data(cp),
83+
Seq(
84+
"src/test/resources/" + input,
85+
"-p",
86+
"Simple",
87+
"-w",
88+
schemaPath.resolve(input).toString
89+
),
90+
(streams.value: @sbtUnchecked).log
91+
)
8792
}
8893
}
8994

9095
lazy val root = (project in file("."))
9196
.settings(
9297
name := "JSONoid Discovery",
93-
9498
libraryDependencies ++= Seq(
95-
bloomFilter,
96-
ddSketch,
97-
json4s,
98-
json4sScalaz,
99-
dbscan,
100-
fuzzySets,
101-
hyperLogLog,
102-
jsonSchemaValidator,
103-
openLocationCode,
104-
scopt,
105-
scalaCsv,
106-
validator,
107-
108-
spark % "provided",
109-
sparkSql % "provided",
110-
111-
scalactic % Test,
112-
scalaTest % Test,
113-
scalaTestPlus % Test,
114-
scalaCheck % Test,
99+
bloomFilter,
100+
ddSketch,
101+
json4s,
102+
json4sScalaz,
103+
dbscan,
104+
fuzzySets,
105+
hyperLogLog,
106+
jsonSchemaValidator,
107+
openLocationCode,
108+
scopt,
109+
scalaCsv,
110+
validator,
111+
spark % "provided",
112+
sparkSql % "provided",
113+
scalactic % Test,
114+
scalaTest % Test,
115+
scalaTestPlus % Test,
116+
scalaCheck % Test
115117
),
116118
dependencyOverrides ++= Seq(
117119
guava,
118120
jacksonDatabind,
119121
protobuf,
120-
snappyJava,
122+
snappyJava
121123
),
122124
javacOptions ++= Seq("-source", "11", "-target", "11"),
123125
scalacOptions ++= nonConsoleCompilerOptions,
124126
buildInfoKeys := Seq[BuildInfoKey](version),
125127
buildInfoPackage := "io.github.dataunitylab.jsonoid.discovery"
126128
)
127129

128-
lazy val fuzz = (project in file("fuzz")).settings(
129-
libraryDependencies ++= Seq(
130-
jazzer,
131-
json4s
132-
)
133-
).dependsOn(root)
130+
lazy val fuzz = (project in file("fuzz"))
131+
.settings(
132+
libraryDependencies ++= Seq(
133+
jazzer,
134+
json4s
135+
)
136+
)
137+
.dependsOn(root)
134138

135139
Compile / compile / wartremoverErrors ++= Seq(
136140
Wart.ArrayEquals,
@@ -158,12 +162,11 @@ Compile / compile / wartremoverErrors ++= Seq(
158162
Wart.TripleQuestionMark,
159163
Wart.TryPartial,
160164
Wart.Var,
161-
Wart.While,
165+
Wart.While
162166
)
163167

164-
Compile / console / scalacOptions := (console / scalacOptions)
165-
.value.filterNot(opt =>
166-
nonConsoleCompilerOptions.contains(opt)
168+
Compile / console / scalacOptions := (console / scalacOptions).value.filterNot(
169+
opt => nonConsoleCompilerOptions.contains(opt)
167170
)
168171

169172
enablePlugins(BuildInfoPlugin)
@@ -185,14 +188,14 @@ git.useGitDescribe := true
185188
Test / fork := true
186189

187190
assembly / assemblyMergeStrategy := {
188-
case "module-info.class" => MergeStrategy.discard
191+
case "module-info.class" => MergeStrategy.discard
189192
case "META-INF/versions/9/module-info.class" => MergeStrategy.discard
190193
case x =>
191194
val oldStrategy = (assembly / assemblyMergeStrategy).value
192195
oldStrategy(x)
193196
}
194197
fuzz / assembly / assemblyMergeStrategy := (assembly / assemblyMergeStrategy).value
195-
assembly / assemblyJarName := s"jsonoid-discovery-${version.value}.jar"
198+
assembly / assemblyJarName := s"jsonoid-discovery-${version.value}.jar"
196199
fuzz / assembly / assemblyJarName := "fuzz.jar"
197200

198201
import sbtassembly.AssemblyPlugin.defaultUniversalScript
@@ -203,7 +206,12 @@ run / connectInput := true
203206
// See https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html for instructions on how to publish to Sonatype.
204207

205208
apiMappings ++= {
206-
def mappingsFor(organization: String, names: List[String], location: String, revision: (String) => String = identity): Seq[(File, URL)] =
209+
def mappingsFor(
210+
organization: String,
211+
names: List[String],
212+
location: String,
213+
revision: (String) => String = identity
214+
): Seq[(File, URL)] =
207215
for {
208216
entry: Attributed[File] <- (Compile / fullClasspath).value
209217
module: ModuleID <- entry.get(moduleID.key)
@@ -212,7 +220,11 @@ apiMappings ++= {
212220
} yield entry.data -> url(location.format(revision(module.revision)))
213221

214222
val mappings: Seq[(File, URL)] =
215-
mappingsFor("org.scala-lang", List("scala-library"), "http://scala-lang.org/api/%s/")
223+
mappingsFor(
224+
"org.scala-lang",
225+
List("scala-library"),
226+
"http://scala-lang.org/api/%s/"
227+
)
216228

217229
mappings.toMap
218230
}

fuzz/src/main/scala/io/github/dataunitylab/jsonoid/discovery/schemas/JsonSchemaFuzzer.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ object JsonSchemaFuzzer {
1111
val json = parse(input)
1212
JsonSchema.fromJson(json)
1313
} catch {
14-
case e: com.fasterxml.jackson.core.JsonParseException =>
14+
case e: com.fasterxml.jackson.core.JsonParseException =>
1515
case e: com.fasterxml.jackson.databind.exc.MismatchedInputException =>
16-
case e: UnsupportedOperationException =>
16+
case e: UnsupportedOperationException =>
1717
}
1818
}
1919
}
20-

project/Dependencies.scala

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,39 @@ import sbt._
33
object Dependencies {
44
// Runtime
55
// XXX json4s cannot currently be upgrade to maintain compatibility with Spark
6-
lazy val json4s = "org.json4s" %% "json4s-jackson" % "3.7.0-M11"
7-
lazy val json4sScalaz = "org.json4s" %% "json4s-scalaz" % "3.7.0-M11"
6+
lazy val json4s = "org.json4s" %% "json4s-jackson" % "3.7.0-M11"
7+
lazy val json4sScalaz = "org.json4s" %% "json4s-scalaz" % "3.7.0-M11"
88

9-
lazy val bloomFilter = "io.github.michaelmior" % "bloomfilter" % "0.10.1"
10-
lazy val dbscan = "io.github.michaelmior" % "dbscan" % "0.2"
11-
lazy val ddSketch = "com.datadoghq" % "sketches-java" % "0.8.3"
12-
lazy val fuzzySets = "io.github.dataunitylab" %% "fuzzy-sets" % "0.4.0"
13-
lazy val hyperLogLog = "com.github.prasanthj" % "hyperloglog" % "1.1"
14-
lazy val jsonSchemaValidator = "com.networknt" % "json-schema-validator" % "1.5.0"
15-
lazy val openLocationCode = "com.google.openlocationcode" % "openlocationcode" % "1.0.4"
16-
lazy val scopt = "com.github.scopt" %% "scopt" % "4.1.0"
17-
lazy val scalaCsv = "com.github.tototoshi" %% "scala-csv" % "2.0.0"
18-
lazy val spark = "org.apache.spark" %% "spark-core" % "3.5.1"
19-
lazy val sparkSql = "org.apache.spark" %% "spark-sql" % "3.5.1"
20-
lazy val validator = "commons-validator" % "commons-validator" % "1.9.0"
9+
lazy val bloomFilter = "io.github.michaelmior" % "bloomfilter" % "0.10.1"
10+
lazy val dbscan = "io.github.michaelmior" % "dbscan" % "0.2"
11+
lazy val ddSketch = "com.datadoghq" % "sketches-java" % "0.8.3"
12+
lazy val fuzzySets = "io.github.dataunitylab" %% "fuzzy-sets" % "0.4.0"
13+
lazy val hyperLogLog = "com.github.prasanthj" % "hyperloglog" % "1.1"
14+
lazy val jsonSchemaValidator =
15+
"com.networknt" % "json-schema-validator" % "1.5.0"
16+
lazy val openLocationCode =
17+
"com.google.openlocationcode" % "openlocationcode" % "1.0.4"
18+
lazy val scopt = "com.github.scopt" %% "scopt" % "4.1.0"
19+
lazy val scalaCsv = "com.github.tototoshi" %% "scala-csv" % "2.0.0"
20+
lazy val spark = "org.apache.spark" %% "spark-core" % "3.5.1"
21+
lazy val sparkSql = "org.apache.spark" %% "spark-sql" % "3.5.1"
22+
lazy val validator = "commons-validator" % "commons-validator" % "1.9.0"
2123

2224
// Test
23-
lazy val jazzer = "com.code-intelligence" % "jazzer" % "0.22.1"
24-
lazy val scalactic = "org.scalactic" %% "scalactic" % "3.2.19"
25-
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.2.19"
26-
lazy val scalaTestPlus = "org.scalatestplus" %% "scalacheck-1-18" % "3.2.19.0"
27-
lazy val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.18.0"
28-
25+
lazy val jazzer = "com.code-intelligence" % "jazzer" % "0.22.1"
26+
lazy val scalactic = "org.scalactic" %% "scalactic" % "3.2.19"
27+
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.2.19"
28+
lazy val scalaTestPlus = "org.scalatestplus" %% "scalacheck-1-18" % "3.2.19.0"
29+
lazy val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.18.0"
2930

3031
// Overrides
3132
// XXX Bundled version is vulnerable to CVE-2018-10237
32-
lazy val guava = "com.google.guava" % "guava" % "33.0.0-jre"
33+
lazy val guava = "com.google.guava" % "guava" % "33.0.0-jre"
3334
// XXX This is necessary for Spark version consistency
34-
lazy val jacksonDatabind = "com.fasterxml.jackson.core" % "jackson-databind" % "2.15.2"
35+
lazy val jacksonDatabind =
36+
"com.fasterxml.jackson.core" % "jackson-databind" % "2.15.2"
3537
// XXX Version bundled with Spark is vulnerable to CVE-2022-3171
36-
lazy val protobuf = "com.google.protobuf" % "protobuf-java" % "3.25.3"
38+
lazy val protobuf = "com.google.protobuf" % "protobuf-java" % "3.25.3"
3739
// XXX Bundled version is vulnerable to CVE-2023-34455
38-
lazy val snappyJava = "org.xerial.snappy" % "snappy-java" % "1.1.10.5"
40+
lazy val snappyJava = "org.xerial.snappy" % "snappy-java" % "1.1.10.5"
3941
}

0 commit comments

Comments
 (0)