Closed nightwolfzor closed 7 years ago
+1 . I got the same problem. Isn't there ever anything about sbt that is straightforward?
scalastyleConfig := baseDirectory.value / "project" / "scalastyle_config.xml"
works for me in a single-module project.
The project in question is a multi-module project. I would like to have different scalastyle rules for the main modules (core, laws, macros) than for the auxillary modules (benchmarks, tests).
I'm also facing a similar issue for a multi-module project.
lazy val scalastyleSettings: Seq[Def.Setting[File]] = {
import org.scalastyle.sbt.ScalastylePlugin.scalastyleConfig
val ssc: Def.Initialize[File] = Def.setting {baseDirectory.value / "project" / "scalastyle_config.xml"}
Seq(
scalastyleConfig in Compile := ssc.value,
scalastyleConfig in Test := ssc.value
)
}
add the scalastyleSettings
to each projects.
if you want to use same scalastyle_config.xml
, should change to the <MAIN_PROJECT>.base
from the baseDirectory.value
.
This is probably fixed now, via #52. Can you test it against the 0.9.0-SNAPSHOT and see if it works please?
To get Scalastyle SBT to work with scalastyle IntelliJ idea plugin, the file needs to be in
./idea
or./project
folders and the config file needs to be calledscalastyle_config.xml
(notscalastyle-config.xml
).This is really silly as you would think everything would be consistent. When trying to set sbt to use the
scalastyle_config.xml
in the project folder in a multi module project it doesnt work!scalastyleConfig := file("project/scalastyle_config.xml")
in sbt;
This is beyond frustrating.