Skip to content

Commit

Permalink
enable scripted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Sep 28, 2024
1 parent babc7f9 commit 9249206
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ lazy val rules212 = rules
.enablePlugins(ScalafixPlugin)
.dependsOn(myRuleRule % ScalafixConfig)
.settings(
// TODO re-enable if warning-diff-scalafix-plugin released
// Test / test := (Test / test).dependsOn(scripted.toTask("")).value,
Test / test := (Test / test).dependsOn(scripted.toTask("")).value,
Compile / compile := (Compile / compile).dependsOn((Compile / scalafix).toTask(" MyScalafixRuleRule")).value,
scriptedBufferLog := false,
scriptedLaunchOpts += ("-Dscalafix-rules.version=" + version.value),
Expand Down
2 changes: 1 addition & 1 deletion rules/src/main/scala/fix/SeparateEachFileRewrite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ class SeparateEachFileRewrite(config: SeparateEachFileConfig) extends SyntacticR
Patch.empty
}

private def isTopLevel(t: Tree): Boolean = t.parent.forall(_.is[Pkg])
private def isTopLevel(t: Tree): Boolean = t.parent.forall(_.is[Pkg.Body])
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % sys.props("scalafix.version"))
addSbtPlugin("com.github.xuwei-k" % "warning-diff-scalafix-plugin" % "0.4.4")
addSbtPlugin("com.github.xuwei-k" % "warning-diff-scalafix-plugin" % "0.5.0")
11 changes: 11 additions & 0 deletions sbt-test/UnmooredDocComment/test-1/expect.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
"endLine": 1,
"endColumn": 10
}
}, {
"message": "[UnmooredDocComment] unmoored doc comment for `Pkg.Body`",
"position": {
"line": 4,
"lineContent": "/** AAA */",
"sourcePath": "${BASE}/A.scala",
"startLine": 4,
"startColumn": 0,
"endLine": 4,
"endColumn": 10
}
}, {
"message": "[UnmooredDocComment] unmoored doc comment for `Term.Param`",
"position": {
Expand Down
2 changes: 1 addition & 1 deletion sbt-test/UnmooredDocComment/test-1/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % sys.props("scalafix.version"))
addSbtPlugin("com.github.xuwei-k" % "warning-diff-scalafix-plugin" % "0.4.4")
addSbtPlugin("com.github.xuwei-k" % "warning-diff-scalafix-plugin" % "0.5.0")

0 comments on commit 9249206

Please sign in to comment.