@@ -45,6 +45,13 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
4545 name := projectName,
4646 organization := " io.iohk" ,
4747 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+ ),
4855 // Scalanet snapshots are published to Sonatype after each build.
4956 resolvers += " Sonatype OSS Snapshots" at " https://oss.sonatype.org/content/repositories/snapshots" ,
5057 testOptions in Test += Tests
@@ -53,7 +60,9 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
5360 " -unchecked" ,
5461 " -deprecation" ,
5562 " -feature" ,
56- " -Xfatal-warnings" ,
63+ // "-Xfatal-warnings", // disabled until unused are removed
64+ " -Ywarn-unused" ,
65+ " -Xlint" ,
5766 " -encoding" ,
5867 " utf-8"
5968 ),
@@ -86,6 +95,7 @@ lazy val bytes = {
8695 .in(file(" bytes" ))
8796 .configs(Integration )
8897 .settings(commonSettings(" mantis-bytes" ))
98+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
8999 .settings(publishSettings)
90100 .settings(
91101 libraryDependencies ++=
@@ -102,6 +112,7 @@ lazy val crypto = {
102112 .configs(Integration )
103113 .dependsOn(bytes)
104114 .settings(commonSettings(" mantis-crypto" ))
115+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
105116 .settings(publishSettings)
106117 .settings(
107118 libraryDependencies ++=
@@ -119,6 +130,7 @@ lazy val rlp = {
119130 .configs(Integration )
120131 .dependsOn(bytes)
121132 .settings(commonSettings(" mantis-rlp" ))
133+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
122134 .settings(publishSettings)
123135 .settings(
124136 libraryDependencies ++=
@@ -176,8 +188,6 @@ lazy val node = {
176188 (test in Evm ) := (test in Evm ).dependsOn(solidityCompile).value
177189 (sourceDirectory in Evm ) := baseDirectory.value / " src" / " evmTest"
178190
179- val sep = java.io.File .separator
180-
181191 val node = project
182192 .in(file(" ." ))
183193 .configs(Integration , Benchmark , Evm , Rpc )
@@ -201,6 +211,9 @@ lazy val node = {
201211 buildInfoOptions in Compile += BuildInfoOption .ToMap
202212 )
203213 .settings(commonSettings(" mantis" ): _* )
214+ .settings(inConfig(Integration )(scalafixConfigSettings(Integration )))
215+ .settings(inConfig(Evm )(scalafixConfigSettings(Evm )))
216+ .settings(inConfig(Rpc )(scalafixConfigSettings(Rpc )))
204217 .settings(
205218 libraryDependencies ++= dep
206219 )
@@ -290,6 +303,36 @@ addCommandAlias(
290303 |""" .stripMargin
291304)
292305
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+
293336// testAll
294337addCommandAlias(
295338 " testAll" ,
0 commit comments