Skip to content

Commit cabbb63

Browse files
committed
spotlessApply
1 parent cfd8a4b commit cabbb63

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

wire-binary-compatibility-gradle-plugin/src/main/kotlin/com/squareup/wire/binarycompatibility/gradle/WireBinaryCompatibilityPlugin.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,

wire-binary-compatibility-kotlin-plugin-tests/src/test/kotlin/com/squareup/wire/binarycompatibility/WireBinaryCompatibilityKotlinPluginTest.kt

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,17 +18,11 @@ package com.squareup.wire.binarycompatibility.kotlin
1818
import assertk.assertThat
1919
import assertk.assertions.contains
2020
import assertk.assertions.containsExactly
21-
import assertk.assertions.containsExactlyInAnyOrder
22-
import assertk.assertions.isEmpty
23-
import assertk.assertions.isFalse
24-
import assertk.assertions.isTrue
2521
import com.tschuchort.compiletesting.JvmCompilationResult
2622
import com.tschuchort.compiletesting.KotlinCompilation
2723
import com.tschuchort.compiletesting.SourceFile
28-
import java.lang.reflect.Modifier
2924
import kotlin.test.Test
3025
import kotlin.test.assertEquals
31-
import kotlin.test.assertFailsWith
3226
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
3327
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
3428

wire-binary-compatibility-kotlin-plugin/src/main/kotlin/com/squareup/wire/binarycompatibility/kotlin/WireBinaryCompatibilityCommandLineProcessor.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,

wire-binary-compatibility-kotlin-plugin/src/main/kotlin/com/squareup/wire/binarycompatibility/kotlin/WireBinaryCompatibilityCompilerPluginRegistrar.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,

wire-binary-compatibility-kotlin-plugin/src/main/kotlin/com/squareup/wire/binarycompatibility/kotlin/WireBinaryCompatibilityIrGenerationExtension.kt

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -50,16 +50,16 @@ import org.jetbrains.kotlin.name.Name
5050

5151
/**
5252
* Rewrites calls to Wire-generated constructors like this:
53-
53+
5454
* ```kotlin
5555
* val money = Money(
5656
* amount = 5,
5757
* currency = "USD",
5858
* )
5959
* ```
60-
*
60+
*
6161
* into calls to the corresponding builders:
62-
*
62+
*
6363
* ```kotlin
6464
* val money = Money.Builder()
6565
* .amount(5)
@@ -114,7 +114,6 @@ class WireConstructorCallRewriter(
114114
val valueParameter = constructorCall.symbol.owner.valueParameters[i]
115115
val parameterFunction = builderSymbol.functions.find { it.owner.valueParameters.size == 1 && it.owner.name == valueParameter.name } ?: return null
116116

117-
118117
+irCall(
119118
callee = parameterFunction,
120119
).apply {
@@ -140,7 +139,7 @@ fun IrFunction.isDeclaredByWireMessageOrBuilder(): Boolean {
140139
return (this.parent as? IrClass)?.superTypes?.any { it.isWireMessageOrBuilder() } ?: false
141140
}
142141

143-
fun IrType.isWireMessageOrBuilder() : Boolean {
142+
fun IrType.isWireMessageOrBuilder(): Boolean {
144143
val classId = this.getClass()?.classId ?: return false
145144
return classId == wireMessage || classId == wireMessageBuilder
146145
}

0 commit comments

Comments
 (0)