Fix tests after disabling trailing comma

#KT-34744
This commit is contained in:
Dmitry Gridin
2020-01-31 16:18:13 +07:00
parent 3fb34596ae
commit c34b417d0c
146 changed files with 612 additions and 945 deletions
+3 -3
View File
@@ -5,19 +5,19 @@ fun test() {
a[1, 2]
a[
1, 2,
1, 2
]
a[
1, 2,
1, 2
]
a[
1, 2,
1, 2
]
+2 -2
View File
@@ -2,6 +2,6 @@
modules = [
AppModule::class,
DataModule::class,
DomainModule::class,
],
DomainModule::class
]
)
@@ -19,7 +19,7 @@ class FooM
}
class FooC(
val x: String,
val x: String
) {
fun bar()
+14 -22
View File
@@ -37,17 +37,13 @@ val s2 = Shadow { // wdwd
val a = 42
}
val s3 = Shadow(
fun() { // wdwd
val a = 42
},
)
val s3 = Shadow(fun() { // wdwd
val a = 42
})
val s4 = Shadow(
fun() { /* s */
val a = 42
},
)
val s4 = Shadow(fun() { /* s */
val a = 42
})
val s5 = Shadow { ->
// wdwd
@@ -59,19 +55,15 @@ val s6 = Shadow {
val a = 42
}
val s7 = Shadow(
fun() {
// wdwd
val a = 42
},
)
val s7 = Shadow(fun() {
// wdwd
val a = 42
})
val s8 = Shadow(
fun() {
// wdwd
val a = 42
},
)
val s8 = Shadow(fun() {
// wdwd
val a = 42
})
val s9 = Shadow { -> /* s */
val a = 42
@@ -1,5 +1,5 @@
fun foo(
x: Int,
x: Int
) {
}
+1 -1
View File
@@ -4,7 +4,7 @@ fun foo() {
?: DescriptorUtils.getParentOfType(
referencedDescriptor,
TypeAliasConstructorDescriptor::class.java,
false,
false
)?.typeAliasDescriptor
?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false)
?: return emptyList()
+1 -1
View File
@@ -4,7 +4,7 @@ fun foo() {
?: DescriptorUtils.getParentOfType(
referencedDescriptor,
TypeAliasConstructorDescriptor::class.java,
false,
false
)?.typeAliasDescriptor
?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false)
?: return emptyList()
+1 -1
View File
@@ -3,6 +3,6 @@ package test
enum class EnumTest(val value: Int) {
VALUE_1
(
value = 0,
value = 0
)
}
+1 -1
View File
@@ -2,7 +2,7 @@
enum class EnumTest(val value: Int) {
VALUE_1(
value = 0,
value = 0
)
}
+1 -1
View File
@@ -2,7 +2,7 @@
enum class EnumTest(val value: Int) {
VALUE_1(
value = 0,
value = 0
)
}
@@ -1,8 +1,6 @@
fun test() {
someTestLong(
12,
13,
)
someTestLong(12,
13)
}
// SET_TRUE: ALIGN_MULTILINE_PARAMETERS_IN_CALLS
+4 -8
View File
@@ -13,10 +13,8 @@ val c = fun() = 4
fun test() = fun test() = 4
fun test() {
test(
fun() {
},
)
test(fun() {
})
test(fun test() {})
test(fun test() = 5)
@@ -30,10 +28,8 @@ fun test() {
test(fun test() = 4)
}
fun d = fun(
a: Int,
b: String,
) {
fun d = fun(a: Int,
b: String) {
}
fun e = fun() {
@@ -1,4 +1,4 @@
open class GFMOutputBuilder(
to: StringBuilder,
to: StringBuilder
) : MarkdownOutputBuilder(to) {
}
@@ -1,5 +1,5 @@
open class GFMOutputBuilder(
to: StringBuilder,
to: StringBuilder
) : MarkdownOutputBuilder(to) {
}
+1 -1
View File
@@ -10,6 +10,6 @@ fun test() {
items,
shippingMethods,
addresses,
preferredAddressId,
preferredAddressId
) = argument
}
+2 -4
View File
@@ -1,9 +1,7 @@
fun foo(
@Deprecated("x")
fun foo(@Deprecated("x")
x: Int,
@Deprecated("y")
@Deprecated("z")
y: Int,
)
y: Int)
// SET_INT: PARAMETER_ANNOTATION_WRAP = 2
+2 -3
View File
@@ -8,8 +8,7 @@ class A(
/**
* Doc
*/
val p2: String,
)
val p2: String)
class B(
/** Doc1 */
@@ -18,5 +17,5 @@ class B(
/**
* Doc2
*/
val v2: Int,
val v2: Int
)
+1 -1
View File
@@ -1,7 +1,7 @@
fun some(
a :Int,
b :String, c :Int,
d :String, e :Int,
d :String, e :Int
) {
}
+1 -1
View File
@@ -1,7 +1,7 @@
fun some(
a: Int,
b: String, c: Int,
d: String, e: Int,
d: String, e: Int
) {
}
+1
View File
@@ -58,3 +58,4 @@ fun some(x: Any) {
}
}
}
// SET_TRUE: ALLOW_TRAILING_COMMA
+1
View File
@@ -66,3 +66,4 @@ else
}
}
}
// SET_TRUE: ALLOW_TRAILING_COMMA
+1 -1
View File
@@ -1,6 +1,6 @@
abstract class RustNavigationContributorBase<T> protected constructor(
private val indexKey: StubIndexKey<String, T>,
private val clazz: Class<T>,
private val clazz: Class<T>
) : ChooseByNameContributor, GotoClassContributor
where T : NavigationItem,
T : RustNamedElement {
@@ -41,12 +41,10 @@ val x8 = foo!!!!!!!!
val x9 = ((b!!)!!!!)!!
.f
val y = xyzzy(
foo
.bar()
.baz()
.quux(),
)
val y = xyzzy(foo
.bar()
.baz()
.quux())
fun foo() {
foo
@@ -91,4 +89,5 @@ fun foo() {
}
// SET_INT: METHOD_CALL_CHAIN_WRAP = 2
// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN
// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN
// SET_TRUE: ALLOW_TRAILING_COMMA
@@ -71,4 +71,5 @@ fun foo() {
}
// SET_INT: METHOD_CALL_CHAIN_WRAP = 2
// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN
// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN
// SET_TRUE: ALLOW_TRAILING_COMMA
+2 -1
View File
@@ -38,4 +38,5 @@ fun foo() {
}
// SET_INT: METHOD_CALL_CHAIN_WRAP = 2
// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN
// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN
// SET_TRUE: ALLOW_TRAILING_COMMA
@@ -12,16 +12,12 @@ fun test() {
fun test1() {
val abc = ArrayList<Int>()
.map(
{
it * 2
},
)
.filter(
{
it > 4
},
)
.map({
it * 2
})
.filter({
it > 4
})
}
fun test2() {
@@ -39,7 +35,7 @@ fun test3() {
fun test4() {
val abc = ArrayList<Int>().mapTo(
LinkedHashSet(),
LinkedHashSet()
) {
it * 2
}
@@ -56,3 +52,4 @@ fun testWithComments() {
}
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
// SET_TRUE: ALLOW_TRAILING_COMMA
@@ -56,3 +56,4 @@ fun testWithComments() {
}
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
// SET_TRUE: ALLOW_TRAILING_COMMA
@@ -52,3 +52,4 @@ fun testWithComments() {
}
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
// SET_TRUE: ALLOW_TRAILING_COMMA
+5 -7
View File
@@ -6,11 +6,9 @@ fun foo() {
finish()
}
FirebaseAuth.getInstance().addAuthStateListener(
object : FirebaseAuth.AuthStateListener {
override fun onAuthStateChanged(auth: FirebaseAuth) {
// ...
}
},
)
FirebaseAuth.getInstance().addAuthStateListener(object : FirebaseAuth.AuthStateListener {
override fun onAuthStateChanged(auth: FirebaseAuth) {
// ...
}
})
}
@@ -10,15 +10,12 @@ fun foo() {
testtest(foofoo)
testtesttesttest(
foofoofoofoofoofoofoofoofoofoofoofoo,
)
foofoofoofoofoofoofoofoofoofoofoofoo)
testtest(foobar, barfoo)
testtesttesttest(
foofoo,
barbar,
foobar,
barfoo,
)
testtesttesttest(foofoo,
barbar,
foobar,
barfoo)
}
@@ -11,15 +11,11 @@ fun foo() {
testtesttesttest(foofoofoofoofoofoofoofoofoofoofoofoo)
testtest(
foobar,
barfoo,
)
testtest(foobar,
barfoo)
testtesttesttest(
foofoo,
barbar,
foobar,
barfoo,
)
testtesttesttest(foofoo,
barbar,
foobar,
barfoo)
}
@@ -10,15 +10,12 @@ fun foo() {
testtest(foofoo)
testtesttesttest(
foofoofoofoofoofoofoofoofoofoofoofoo,
)
foofoofoofoofoofoofoofoofoofoofoofoo)
testtest(foobar, barfoo)
testtesttesttest(
foofoo,
barbar,
foobar,
barfoo,
)
testtesttesttest(foofoo,
barbar,
foobar,
barfoo)
}
@@ -4,10 +4,8 @@
fun foo() {
foo(bar, baz)
foo(
object : Quux {
override fun foo() {
}
},
)
foo(object : Quux {
override fun foo() {
}
})
}
@@ -1,12 +1,12 @@
fun foo(
x: Int =
42,
42
) {
}
class C(
val x: Int =
42,
42
)
// SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -1,12 +1,12 @@
fun foo(
x: Int =
42,
42
) {
}
class C(
val x: Int =
42,
42
)
// SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
+11 -20
View File
@@ -5,28 +5,19 @@ fun useCallable(tag: String, callable: Callable<*>) {
fun main(args: Array<String>) {
useCallable("A", Callable { println("Hello world") })
useCallable(
"B",
Callable {
println("Hello world")
},
)
useCallable("B", Callable {
println("Hello world")
})
useCallable(
"C",
object : Callable<Unit> {
override fun call() {
println("Hello world")
}
},
)
useCallable("C", object : Callable<Unit> {
override fun call() {
println("Hello world")
}
})
useCallable(
"B",
fun() {
println("Hello world")
},
)
useCallable("B", fun() {
println("Hello world")
})
}
// SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE
@@ -12,12 +12,10 @@ fun testtesttesttest(foofoo: Int)
fun test(foo: Int, bar: Int)
fun testtesttesttest(
foofoo: Int,
barbar: Int,
foobar: Int,
barfoo: Int,
)
fun testtesttesttest(foofoo: Int,
barbar: Int,
foobar: Int,
barfoo: Int)
fun test() {
for (foo: Int in bar) {
@@ -41,34 +39,26 @@ class LongLongLongLongNameCLass
class ShorName
class SN
class A(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass3: LongLongLongLongNameCLass) {
constructor(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass3: LongLongLongLongNameCLass) {
}
}
class B(
a: LongLongLongLongNameCLass,
class B(a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass,
) {
constructor(
a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass,
) {
c: LongLongLongLongNameCLass) {
constructor(a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass) {
}
}
class C(
sn1: ShorName,
class C(sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
@@ -76,24 +66,20 @@ class C(
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName,
) {
constructor(
sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
sn5: ShorName,
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName,
) {
sn9: ShorName) {
constructor(sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
sn5: ShorName,
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName) {
}
}
class D(
sn1: SN,
class D(sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
@@ -106,31 +92,27 @@ class D(
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
constructor(
sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
sn14: SN) {
constructor(sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN) {
}
}
class E(longLongLongLongNameCLass1: LongLongLongLongNameCLass) {
constructor(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass1: LongLongLongLongNameCLass) {
}
}
@@ -10,31 +10,23 @@ fun testtest(foofoo: Int)
fun testtesttesttest(foofoo: Int)
fun test(
foo: Int,
bar: Int,
)
fun test(foo: Int,
bar: Int)
fun testtesttesttest(
foofoo: Int,
barbar: Int,
foobar: Int,
barfoo: Int,
)
fun testtesttesttest(foofoo: Int,
barbar: Int,
foobar: Int,
barfoo: Int)
fun testtesttesttest(
foofoo: Int,
@Some barbar: Int,
foobar: Int,
barfoo: Int,
)
fun testtesttesttest(foofoo: Int,
@Some barbar: Int,
foobar: Int,
barfoo: Int)
fun testtesttesttest(
@Some foofoo: Int,
@Some barbar: Int,
@Some foobar: Int,
barfoo: Int,
)
fun testtesttesttest(@Some foofoo: Int,
@Some barbar: Int,
@Some foobar: Int,
barfoo: Int)
fun test() {
for (foo: Int in bar) {
@@ -58,34 +50,25 @@ class LongLongLongLongNameCLass
class ShorName
class SN
class A(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass,
) {
constructor(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass3: LongLongLongLongNameCLass) {
constructor(longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass) {
}
}
class B(
a: LongLongLongLongNameCLass,
class B(a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass,
) {
constructor(
a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass,
) {
c: LongLongLongLongNameCLass) {
constructor(a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass) {
}
}
class C(
sn1: ShorName,
class C(sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
@@ -93,24 +76,20 @@ class C(
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName,
) {
constructor(
sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
sn5: ShorName,
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName,
) {
sn9: ShorName) {
constructor(sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
sn5: ShorName,
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName) {
}
}
class D(
sn1: SN,
class D(sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
@@ -123,24 +102,21 @@ class D(
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
constructor(
sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
sn14: SN) {
constructor(sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN) {
}
}
@@ -159,16 +135,13 @@ class G(sn1: ShorName) {
}
}
class H(
sn1: SN,
sn2: SN,
) {
class H(sn1: SN,
sn2: SN) {
constructor(sn1: SN) {
}
}
class I(
sn1: SN,
class I(sn1: SN,
@field:Some val sn2: SN,
sn3: SN,
sn4: SN,
@@ -181,23 +154,20 @@ class I(
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
constructor(
sn1: SN,
sn2: SN,
sn3: SN,
@Some sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
sn14: SN) {
constructor(sn1: SN,
sn2: SN,
sn3: SN,
@Some sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN) {
}
}
@@ -9,8 +9,7 @@ fun testtesttesttesttesttesttesttesttest()
fun testtest(foofoo: Int)
fun testtesttesttest(
foofoo: Int,
)
foofoo: Int)
fun test(foo: Int, bar: Int)
@@ -18,8 +17,7 @@ fun testtesttesttest(
foofoo: Int,
barbar: Int,
foobar: Int,
barfoo: Int,
)
barfoo: Int)
fun test() {
for (foo: Int in bar) {
@@ -43,34 +41,27 @@ class LongLongLongLongNameCLass
class ShorName
class SN
class A(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass3: LongLongLongLongNameCLass) {
constructor(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
longLongLongLongNameCLass2: LongLongLongLongNameCLass,
longLongLongLongNameCLass3: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass3: LongLongLongLongNameCLass) {
}
}
class B(
a: LongLongLongLongNameCLass,
class B(a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass,
) {
c: LongLongLongLongNameCLass) {
constructor(
a: LongLongLongLongNameCLass,
b: LongLongLongLongNameCLass,
c: LongLongLongLongNameCLass,
) {
c: LongLongLongLongNameCLass) {
}
}
class C(
sn1: ShorName,
class C(sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
@@ -78,68 +69,58 @@ class C(
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName,
) {
constructor(
sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
sn5: ShorName,
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName,
) {
sn9: ShorName) {
constructor(sn1: ShorName,
sn2: ShorName,
sn3: ShorName,
sn4: ShorName,
sn5: ShorName,
sn6: ShorName,
sn6: ShorName,
sn8: ShorName,
sn9: ShorName) {
}
}
class D(
sn1: SN, sn2: SN,
class D(sn1: SN, sn2: SN,
sn3: SN, sn4: SN,
sn5: SN, sn6: SN,
sn6: SN, sn8: SN,
sn9: SN, sn10: SN,
sn11: SN, sn12: SN,
sn13: SN, sn14: SN,
) {
constructor(
sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN,
) {
sn13: SN, sn14: SN) {
constructor(sn1: SN,
sn2: SN,
sn3: SN,
sn4: SN,
sn5: SN,
sn6: SN,
sn6: SN,
sn8: SN,
sn9: SN,
sn10: SN,
sn11: SN,
sn12: SN,
sn13: SN,
sn14: SN) {
}
}
class E(longLongLongLongNameCLass1: LongLongLongLongNameCLass) {
constructor(
longLongLongLongNameCLass1: LongLongLongLongNameCLass,
) {
longLongLongLongNameCLass1: LongLongLongLongNameCLass) {
}
}
class F(a: LongLongLongLongNameCLass) {
constructor(
a: LongLongLongLongNameCLass,
) {
a: LongLongLongLongNameCLass) {
}
}
class G(sn1: ShorName) {
constructor(
sn1: ShorName,
) {
sn1: ShorName) {
}
}