forked from scalacenter/scalafix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP unit3: all changes applied so far
This is the commit message scalacenter#2: WIP unit3 to show code, not working unit3 munit dep: exclude 2.13 and include munit_3 instead WIP unit3 fixed some unit3 compilation errors, many errors, all similar, on unit2* to fix This is the commit message scalacenter#2: fixed compilation error unit SaveExpect class () unit2Target2 fix with scalatest version to 3.2.0, but this shouldn't be bumped as per comment(breaking clients via eviction) fix unit2Target2 by reintroducing scalatest 3.2.0 in unit libs for scala2 versions unit3 fix Test/compilation errors unit3 test RuleDecoderSuite: removed scalafix.v1.Rule rules not available in scala3: explicitResultTypes and ProcedureSintax unit3 moved test ScalafixArgumentsSuite to scala-2, cause it depends on semanticdb-scalac_3.1.3 unit3 changed CliGitDiffSuite.'works on Patch' to not use ProcedureSyntaxRule cause not available for scala3 Revert "unit3 moved test ScalafixArgumentsSuite to scala-2, cause it depends on semanticdb-scalac_3.1.3" This reverts commit 7bad87b. unit3 ScalafixArgumentSuite compat/semanticdb split, version 2 pr comments applied unit3 unmanagedresources folders for cross compilation, scalafmt and scalafixAll applied unit3 introduced CompatSemanticdb for scala3 with semanticdb new options, fixed one unit test
- Loading branch information
Showing
22 changed files
with
202 additions
and
244 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
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
scalafix-rules/src/main/resources-3/META-INF/services/scalafix.v1.Rule
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
scalafix.internal.rule.DisableSyntax | ||
# scalafix.internal.rule.ExplicitResultTypes # comment out once scala-3 ExplicitResultTypes is implemented | ||
scalafix.internal.rule.NoAutoTupling | ||
scalafix.internal.rule.NoValInForComprehension | ||
scalafix.internal.rule.RedundantSyntax | ||
scalafix.internal.rule.RemoveUnused | ||
scalafix.internal.rule.LeakingImplicitClassVal |
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
10 changes: 7 additions & 3 deletions
10
scalafix-tests/unit/src/main/scala/scalafix/test/NoNull.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,13 +1,17 @@ | ||
package scalafix.test | ||
|
||
import scala.meta._ | ||
import scala.meta.Lit | ||
import scala.meta.XtensionCollectionLikeUI | ||
|
||
import scalafix.v0._ | ||
import scalafix.lint.Diagnostic | ||
import scalafix.v0.LintCategory | ||
import scalafix.v0.Rule | ||
import scalafix.v0.RuleCtx | ||
|
||
object NoNull extends Rule("NoNull") { | ||
val error: LintCategory = LintCategory.error("Nulls are not allowed.") | ||
|
||
override def check(ctx: RuleCtx): List[Diagnostic] = ctx.tree.collect { | ||
case nil @ q"null" => error.at(nil.pos) | ||
case nil @ Lit.Null() => error.at(nil.pos) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
scalafix-tests/unit/src/test/scala-2/scalafix/tests/util/compat/CompatSemanticdb.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package scalafix.tests.util.compat | ||
|
||
import java.nio.file.Path | ||
|
||
import scala.tools.nsc.Main | ||
object CompatSemanticdb { | ||
|
||
def scalacOptions(src: Path, target: Path): Array[String] = { | ||
Array[String]( | ||
s"-P:semanticdb:targetroot:$target" | ||
) ++ scalacOptions(src) | ||
} | ||
|
||
def scalacOptions(src: Path): Array[String] = { | ||
Array[String]( | ||
s"-Xplugin:${SemanticdbPlugin.semanticdbPluginPath()}", | ||
"-Xplugin-require:semanticdb", | ||
s"-P:semanticdb:sourceroot:$src" | ||
) | ||
} | ||
|
||
def runScalac(scalacOptions: Seq[String]): Unit = { | ||
Main.process(scalacOptions.toArray) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...calafix/tests/util/SemanticdbPlugin.scala → .../tests/util/compat/SemanticdbPlugin.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,4 +1,4 @@ | ||
package scalafix.tests.util | ||
package scalafix.tests.util.compat | ||
|
||
import java.nio.file.Paths | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
scalafix-tests/unit/src/test/scala-3/scalafix/tests/util/compat/CompatSemanticdb.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package scalafix.tests.util.compat | ||
|
||
import java.nio.file.Path | ||
import dotty.tools.dotc.Main | ||
|
||
object CompatSemanticdb { | ||
|
||
def scalacOptions(src: Path, target: Path): Array[String] = { | ||
Array[String]( | ||
s"-semanticdb-target:$target" | ||
) ++ scalacOptions(src) | ||
} | ||
|
||
def scalacOptions(src: Path): Array[String] = { | ||
Array[String]( | ||
"-Xsemanticdb", | ||
"-Xplugin-require:semanticdb" // , | ||
// s"-P:semanticdb:sourceroot:$src" | ||
) | ||
} | ||
|
||
def runScalac(scalacOptions: Seq[String]): Unit = { | ||
Main.process(scalacOptions.toArray) | ||
} | ||
} |
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
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
Oops, something went wrong.