@@ -45,6 +45,13 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
45
45
name := projectName,
46
46
organization := " io.iohk" ,
47
47
scalaVersion := `scala-2.13`,
48
+ semanticdbEnabled := true , // enable SemanticDB
49
+ semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version
50
+ ThisBuild / scalafixScalaBinaryVersion := CrossVersion .binaryScalaVersion(scalaVersion.value),
51
+ ThisBuild / scalafixDependencies ++= List (
52
+ " com.github.liancheng" %% " organize-imports" % " 0.5.0" ,
53
+ " com.github.vovapolu" %% " scaluzzi" % " 0.1.16"
54
+ ),
48
55
// Scalanet snapshots are published to Sonatype after each build.
49
56
resolvers += " Sonatype OSS Snapshots" at " https://oss.sonatype.org/content/repositories/snapshots" ,
50
57
testOptions in Test += Tests
@@ -53,7 +60,9 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
53
60
" -unchecked" ,
54
61
" -deprecation" ,
55
62
" -feature" ,
56
- " -Xfatal-warnings" ,
63
+ // "-Xfatal-warnings", // disabled until unused are removed
64
+ " -Ywarn-unused" ,
65
+ " -Xlint" ,
57
66
" -encoding" ,
58
67
" utf-8"
59
68
),
@@ -86,6 +95,7 @@ lazy val bytes = {
86
95
.in(file(" bytes" ))
87
96
.configs(Integration )
88
97
.settings(commonSettings(" mantis-bytes" ))
98
+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
89
99
.settings(publishSettings)
90
100
.settings(
91
101
libraryDependencies ++=
@@ -102,6 +112,7 @@ lazy val crypto = {
102
112
.configs(Integration )
103
113
.dependsOn(bytes)
104
114
.settings(commonSettings(" mantis-crypto" ))
115
+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
105
116
.settings(publishSettings)
106
117
.settings(
107
118
libraryDependencies ++=
@@ -119,6 +130,7 @@ lazy val rlp = {
119
130
.configs(Integration )
120
131
.dependsOn(bytes)
121
132
.settings(commonSettings(" mantis-rlp" ))
133
+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
122
134
.settings(publishSettings)
123
135
.settings(
124
136
libraryDependencies ++=
@@ -176,8 +188,6 @@ lazy val node = {
176
188
(test in Evm ) := (test in Evm ).dependsOn(solidityCompile).value
177
189
(sourceDirectory in Evm ) := baseDirectory.value / " src" / " evmTest"
178
190
179
- val sep = java.io.File .separator
180
-
181
191
val node = project
182
192
.in(file(" ." ))
183
193
.configs(Integration , Benchmark , Evm , Rpc )
@@ -201,6 +211,9 @@ lazy val node = {
201
211
buildInfoOptions in Compile += BuildInfoOption .ToMap
202
212
)
203
213
.settings(commonSettings(" mantis" ): _* )
214
+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
215
+ .settings(inConfig(Evm )(scalafixConfigSettings(Evm )))
216
+ .settings(inConfig(Rpc )(scalafixConfigSettings(Rpc )))
204
217
.settings(
205
218
libraryDependencies ++= dep
206
219
)
@@ -290,6 +303,36 @@ addCommandAlias(
290
303
|""" .stripMargin
291
304
)
292
305
306
+ // format all modules
307
+ addCommandAlias(
308
+ " formatAll" ,
309
+ """ ;compile-all
310
+ |;bytes/scalafixAll
311
+ |;bytes/scalafmtAll
312
+ |;crypto/scalafixAll
313
+ |;crypto/scalafmtAll
314
+ |;rlp/scalafixAll
315
+ |;rlp/scalafmtAll
316
+ |;scalafixAll
317
+ |;scalafmtAll
318
+ |""" .stripMargin
319
+ )
320
+
321
+ // check modules formatting
322
+ addCommandAlias(
323
+ " formatCheck" ,
324
+ """ ;compile-all
325
+ |;bytes/scalafixAll --check
326
+ |;bytes/scalafmtCheckAll
327
+ |;crypto/scalafixAll --check
328
+ |;crypto/scalafmtCheckAll
329
+ |;rlp/scalafixAll --check
330
+ |;rlp/scalafmtCheckAll
331
+ |;scalafixAll --check
332
+ |;scalafmtCheckAll
333
+ |""" .stripMargin
334
+ )
335
+
293
336
// testAll
294
337
addCommandAlias(
295
338
" testAll" ,
0 commit comments