Skip to content

Commit a97d121

Browse files
committed
disable scapegoat in tests
1 parent 4b43bee commit a97d121

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

project/Common.scala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ object Common {
2424
case v if v.startsWith("2.13") => "3.1.2"
2525
case _ => "3.1.9"
2626
})),
27-
scalacOptions ++= Seq(
28-
s"-P:scapegoat:dataDir:${crossTarget.value}/scapegoat-report",
29-
"-P:scapegoat:reports:xml:html:markdown"))
27+
// Only enable Scapegoat for main source code, not tests
28+
Compile / scalacOptions ++= Seq(
29+
s"-P:scapegoat:dataDir:${(Compile / crossTarget).value}/scapegoat-report",
30+
"-P:scapegoat:reports:xml:html:markdown",
31+
"-P:scapegoat:disabledInspections:VariableShadowing", // Disable variable shadowing warnings
32+
"-P:scapegoat:sourceDirectories:src/main"), // Only analyze main source directories
33+
// Explicitly exclude Scapegoat from test compilation
34+
Test / scalacOptions := (Test / scalacOptions).value.filterNot(_.contains("scapegoat")))
3035

3136
val genericSettings = Seq(
3237
scalacOptions ++= Common.compilerFlags(scalaVersion.value),

0 commit comments

Comments
 (0)