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.
Squashed commits: WIP - Unit3 cross compilation and test fixes
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 This is the commit message scalacenter#2: unit 3 PrettyExpectSuite split expected results between scala2 and 3 This is the commit message scalacenter#3: unit 3 Apply suggestions from code review, small changes to build and rules Co-authored-by: Brice Jaglin <bjaglin@gmail.com> This is the commit message scalacenter#4: change scalatest dep and refactored jgit This is the commit message scalacenter#5: fix windows ci scaladoc issue on paths: upgrade scala3 to 3.2.0 This is the commit message scalacenter#6: unit3 test rulecompiler This is the commit message scalacenter#7: unit3 ToolClasspathSuite changed dependency to scalatest and renamings This is the commit message scalacenter#8: unit3 ScalafixArgumentsSuite and classes to provide compiler options This is the commit message scalacenter#9: unit3 scalafmt and scalafixAll
- Loading branch information
Showing
27 changed files
with
374 additions
and
293 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
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
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,6 @@ | ||
scalafix.internal.rule.DisableSyntax | ||
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
File renamed without changes.
113 changes: 113 additions & 0 deletions
113
scalafix-tests/unit/src/main/resources-3/expect/Pretty.expect
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,113 @@ | ||
[6:7..6:17]: test/PrettyTest# => class PrettyTest extends Object { self: PrettyTest => +6 decls } | ||
[7:3..7:14]: *[Int] | ||
[7:3..7:7]: *.apply[Int] | ||
[9:10..9:11]: intWrapper(*) | ||
[10:10..10:11]: intWrapper(*) | ||
[14:10..14:16]: *.apply[Inclusive] | ||
[14:10..14:26]: *(global) | ||
[14:17..14:18]: intWrapper(*) | ||
[15:10..15:16]: *.apply[Inclusive] | ||
[15:10..15:32]: *(global) | ||
[15:17..15:18]: intWrapper(*) | ||
[20:9..20:14]: test/PrettyTest#Inner# => class Inner extends Object { self: Inner => +1 decls } | ||
[21:7..21:8]: test/PrettyTest#a. => val method aPrettyTest | ||
[22:7..22:8]: test/PrettyTest#b. => val method ba.Inner | ||
[24:3..24:9]: *.apply[Object { | ||
local4 => abstract method foo(a: Int): Int | ||
local5 => abstract method bar(a: Int): Int | ||
}] | ||
[28:3..28:9]: *.apply[a.Inner] | ||
[29:3..29:9]: *.apply[Int & String] | ||
[30:3..30:9]: *.apply[PrettyTest] | ||
[37:7..37:10]: test/ann# => class ann[T] extends Annotation with StaticAnnotation { self: ann[T] => +3 decls } | ||
[37:11..37:12]: test/ann#[T] => typeparam T | ||
[37:14..37:15]: test/ann#x. => private[this] val method xT | ||
[38:7..38:11]: test/ann1# => class ann1 extends Annotation with StaticAnnotation { self: ann1 => +1 decls } | ||
[39:7..39:11]: test/ann2# => class ann2 extends Annotation with StaticAnnotation { self: ann2 => +1 decls } | ||
[41:7..41:8]: test/B# => class B extends Object { self: B => +1 decls } | ||
[43:7..43:8]: test/C# => class C extends Object { self: C => +1 decls } | ||
[45:7..45:8]: test/P# => class P extends Object { self: P => +8 decls } | ||
[46:9..46:10]: test/P#C# => class C extends Object { self: C => +1 decls } | ||
[47:9..47:10]: test/P#X# => class X extends Object { self: X => +1 decls } | ||
[48:7..48:8]: test/P#x. => val method xX | ||
[51:7..51:8]: test/T# => class T extends Object { self: T => +8 decls } | ||
[52:9..52:10]: test/T#C# => class C extends Object { self: C => +1 decls } | ||
[53:9..53:10]: test/T#X# => class X extends Object { self: X => +1 decls } | ||
[54:7..54:8]: test/T#x. => val method xX | ||
[57:8..57:12]: test/Test. => final object Test extends Object { self: Test.type => +10 decls } | ||
[58:9..58:10]: test/Test.M# => class M extends Object { self: M => +2 decls } | ||
[59:9..59:10]: test/Test.M#m(). => method m=> Int | ||
[62:9..62:10]: test/Test.N# => trait N extends Object { self: N => +2 decls } | ||
[63:9..63:10]: test/Test.N#n(). => method n=> Int | ||
[66:9..66:10]: test/Test.C# => class C extends M { self: C => +42 decls } | ||
[67:9..67:10]: test/Test.C#p. => val method pP | ||
[68:9..68:10]: test/Test.C#x. => val method xp.X | ||
[70:9..70:17]: test/Test.C#typeRef1. => val method typeRef1C | ||
[71:9..71:17]: test/Test.C#typeRef2. => val method typeRef2p.C | ||
[72:9..72:17]: test/Test.C#typeRef3. => val method typeRef3T#C | ||
[73:9..73:17]: test/Test.C#typeRef4. => val method typeRef4List[Int] | ||
[75:9..75:20]: test/Test.C#singleType1. => val method singleType1x.type | ||
[76:9..76:20]: test/Test.C#singleType2. => val method singleType2p.x.type | ||
[77:9..77:15]: test/Test.C#Either. => val method EitherEither.type | ||
[79:9..79:18]: test/Test.C#thisType1. => val method thisType1C.this.type | ||
[80:9..80:18]: test/Test.C#thisType2. => val method thisType2C.this.type | ||
[82:9..82:19]: test/Test.C#superType1. => val method superType1Int | ||
[83:9..83:19]: test/Test.C#superType2. => val method superType2Int | ||
[84:9..84:19]: test/Test.C#superType3. => val method superType3Int | ||
[86:9..86:22]: test/Test.C#compoundType1. => val method compoundType1Object { def k=> Int } | ||
[87:9..87:22]: test/Test.C#compoundType2. => val method compoundType2M & N | ||
[88:9..88:22]: test/Test.C#compoundType3. => val method compoundType3M & N { def k=> Int } | ||
[89:9..89:22]: test/Test.C#compoundType4. => val method compoundType4Object | ||
[90:9..90:22]: test/Test.C#compoundType5. => val method compoundType5M & N | ||
[91:9..91:22]: test/Test.C#compoundType6. => val method compoundType6M & N | ||
[93:9..93:17]: test/Test.C#annType1. => val method annType1T @ann[T] | ||
[93:21..93:25]: [Int] | ||
[94:9..94:17]: test/Test.C#annType2. => val method annType2T @ann1 @ann2 | ||
[96:9..96:25]: test/Test.C#existentialType2. => val method existentialType2List[_] forSome { type _ } | ||
[97:9..97:25]: test/Test.C#existentialType3. => val method existentialType3Class[_] forSome { type _ } | ||
[98:9..98:25]: test/Test.C#existentialType4. => val method existentialType4Class[_] forSome { type _ } | ||
[100:9..100:20]: test/Test.C#typeLambda1(). => method typeLambda1[M[type _]]: Nothing | ||
[100:21..100:22]: test/Test.C#typeLambda1().[M] => typeparam M[type _] | ||
[103:12..103:26]: test/Test.C#ClassInfoType1. => final object ClassInfoType1 extends Object { self: ClassInfoType1.type => +1 decls } | ||
[104:11..104:25]: test/Test.C#ClassInfoType2# => class ClassInfoType2 extends B { self: ClassInfoType2 => +2 decls } | ||
[104:42..104:43]: test/Test.C#ClassInfoType2#x(). => method x=> Int | ||
[105:11..105:25]: test/Test.C#ClassInfoType3# => trait ClassInfoType3[T] extends Object { self: ClassInfoType3[T] => +2 decls } | ||
[105:26..105:27]: test/Test.C#ClassInfoType3#[T] => typeparam T | ||
[107:12..107:22]: test/Test.C#MethodType. => final object MethodType extends Object { self: MethodType.type => +7 decls } | ||
[108:11..108:13]: test/Test.C#MethodType.x1(). => method x1=> Int | ||
[109:11..109:13]: test/Test.C#MethodType.x2(). => method x2=> Int | ||
[110:11..110:13]: test/Test.C#MethodType.m3(). => method m3=> Int | ||
[111:11..111:13]: test/Test.C#MethodType.m4(). => method m4(): Int | ||
[112:11..112:13]: test/Test.C#MethodType.m5(). => method m5(x: Int): Int | ||
[112:14..112:15]: test/Test.C#MethodType.m5().(x) => param x: Int | ||
[113:11..113:13]: test/Test.C#MethodType.m6(). => method m6[T](x: T): T | ||
[113:14..113:15]: test/Test.C#MethodType.m6().[T] => typeparam T | ||
[113:17..113:18]: test/Test.C#MethodType.m6().(x) => param x: T | ||
[116:12..116:22]: test/Test.C#ByNameType. => final object ByNameType extends Object { self: ByNameType.type => +2 decls } | ||
[117:11..117:13]: test/Test.C#ByNameType.m1(). => method m1(x: => Int): Int | ||
[117:14..117:15]: test/Test.C#ByNameType.m1().(x) => param x: => Int | ||
[120:16..120:28]: test/Test.C#RepeatedType# => case class RepeatedType extends Object with Product with Serializable { self: RepeatedType => +4 decls } | ||
[120:29..120:30]: test/Test.C#RepeatedType#s. => val method sString* | ||
[121:11..121:13]: test/Test.C#RepeatedType#m1(). => method m1(x: Int*): Int | ||
[121:14..121:15]: test/Test.C#RepeatedType#m1().(x) => param x: Int* | ||
[124:12..124:20]: test/Test.C#TypeType. => final object TypeType extends Object { self: TypeType.type => +6 decls } | ||
[125:12..125:14]: test/Test.C#TypeType.T1# => type T1 | ||
[126:11..126:13]: test/Test.C#TypeType.m2(). => method m2[T2 = C]: Nothing | ||
[126:14..126:16]: test/Test.C#TypeType.m2().[T2] => typeparam T2 = C | ||
[127:11..127:13]: test/Test.C#TypeType.m3(). => method m3[M3[type _]]: Nothing | ||
[127:14..127:16]: test/Test.C#TypeType.m3().[M3] => typeparam M3[type _] | ||
[128:12..128:14]: test/Test.C#TypeType.T4# => type T4 = C | ||
[129:12..129:14]: test/Test.C#TypeType.T5# => type T5[U] = U | ||
[129:15..129:16]: test/Test.C#TypeType.T5#[U] => typeparam U | ||
[133:10..133:17]: test/Test.Literal. => final object Literal extends Object { self: Literal.type => +12 decls } | ||
[134:15..134:18]: test/Test.Literal.int. => final val method int1 | ||
[135:15..135:19]: test/Test.Literal.long. => final val method long1L | ||
[136:15..136:20]: test/Test.Literal.float. => final val method float1.0f | ||
[137:15..137:21]: test/Test.Literal.double. => final val method double2.0 | ||
[138:15..138:18]: test/Test.Literal.nil. => final val method nilNull | ||
[139:15..139:19]: test/Test.Literal.char. => final val method char'a' | ||
[140:15..140:21]: test/Test.Literal.string. => final val method string"a" | ||
[141:15..141:19]: test/Test.Literal.bool. => final val method booltrue | ||
[142:15..142:19]: test/Test.Literal.unit. => final val method unitUnit | ||
[143:15..143:23]: test/Test.Literal.javaEnum. => final val method javaEnumLinkOption | ||
[144:15..144:22]: test/Test.Literal.clazzOf. => final val method clazzOfOption[Int] |
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) | ||
} | ||
} |
Oops, something went wrong.