-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scalafix: add scalafix.dep, more tests
- Loading branch information
Showing
9 changed files
with
249 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
modules/integration/src/test/scala/scala/cli/integration/ScalafixTests213.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,6 @@ | ||
package scala.cli.integration | ||
|
||
import com.eed3si9n.expecty.Expecty.expect | ||
|
||
class ScalafixTests213 extends ScalafixTestDefinitions with Test213 { | ||
override val unusedRuleOption: String = "-Wunused" | ||
|
||
test("external rule") { | ||
val unnamedParamsInputsContent: String = | ||
"""//> using options -P:semanticdb:synthetics:on | ||
|//> using compileOnly.dep "com.github.jatcwang::scalafix-named-params:0.2.5" | ||
| | ||
|package foo | ||
| | ||
|object Hello { | ||
| def greetMany(name: String, times: Int) = | ||
| for { | ||
| i <- 0 to times | ||
| _ = println(s"Hello $name") | ||
| } yield () | ||
| | ||
| def main(args: Array[String]): Unit = | ||
| greetMany("John", 42) | ||
|} | ||
|""".stripMargin | ||
val externalRuleInputs: TestInputs = TestInputs( | ||
os.rel / confFileName -> | ||
s"""|rules = [ | ||
| UseNamedParameters | ||
|] | ||
| | ||
|UseNamedParameters.minParams = 2 | ||
|""".stripMargin, | ||
os.rel / "Hello.scala" -> unnamedParamsInputsContent | ||
) | ||
val expectedContent: String = noCrLf { | ||
"""//> using options -P:semanticdb:synthetics:on | ||
|//> using compileOnly.dep "com.github.jatcwang::scalafix-named-params:0.2.5" | ||
| | ||
|package foo | ||
| | ||
|object Hello { | ||
| def greetMany(name: String, times: Int) = | ||
| for { | ||
| i <- 0 to times | ||
| _ = println(s"Hello $name") | ||
| } yield () | ||
| | ||
| def main(args: Array[String]): Unit = | ||
| greetMany(name = "John", times = 42) | ||
|} | ||
|""".stripMargin | ||
} | ||
|
||
externalRuleInputs.fromRoot { root => | ||
os.proc(TestUtil.cli, "scalafix", "--power", ".", "-S", "2").call(cwd = root) | ||
val updatedContent = noCrLf(os.read(root / "Hello.scala")) | ||
expect(updatedContent == expectedContent) | ||
} | ||
} | ||
} |
Oops, something went wrong.