Skip to content

Commit c100e35

Browse files
authored
Merge pull request #36 from tobrun/kdz-fix-intendations
Fix indentations
2 parents 6959447 + e703578 commit c100e35

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ And you will have to include the required dependencies:
2828

2929
```groovy
3030
dependencies {
31-
implementation 'com.github.tobrun.kotlin-data-compat:annotation:0.5.0'
32-
ksp 'com.github.tobrun.kotlin-data-compat:processor:0.5.0'
31+
implementation 'com.github.tobrun.kotlin-data-compat:annotation:0.5.1'
32+
ksp 'com.github.tobrun.kotlin-data-compat:processor:0.5.1'
3333
}
3434
```
3535

@@ -172,10 +172,10 @@ public class Person private constructor(
172172
*/
173173
public fun build(): Person {
174174
if (name==null) {
175-
throw IllegalArgumentException("Null name found when building Person.")
175+
throw IllegalArgumentException("""Null name found when building Person.""".trimIndent())
176176
}
177177
if (age==null) {
178-
throw IllegalArgumentException("Null age found when building Person.")
178+
throw IllegalArgumentException("""Null age found when building Person.""".trimIndent())
179179
}
180180
return Person(name!!, nickname, age!!)
181181
}

processor/src/main/kotlin/com/tobrun/datacompat/DataCompatProcessor.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ class DataCompatProcessor(
212212
.addStatement(
213213
propertyMap.keys.joinToString(
214214
prefix = "return ",
215-
separator = " && ",
216-
transform = { "$it == other.$it" },
215+
separator = "·&& ",
216+
transform = { "$it·==·other.$it" },
217217
postfix = ""
218218
)
219219
)
@@ -330,7 +330,9 @@ class DataCompatProcessor(
330330
if (!property.value.isNullable) {
331331
buildFunction.addStatement("if (${property.key}==null) {")
332332
val exceptionMessage = "Null ${property.key} found when building $className."
333-
buildFunction.addStatement("\tthrow IllegalArgumentException(\"$exceptionMessage\")")
333+
buildFunction.addStatement(
334+
"\tthrow IllegalArgumentException(\"\"\"$exceptionMessage\"\"\".trimIndent())"
335+
)
334336
buildFunction.addStatement("}")
335337
}
336338
}

processor/src/test/kotlin/com/tobrun/datacompat/SimpleTestContent.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ internal val expectedSimpleTestContent = """
122122
*/
123123
public fun build(): Person {
124124
if (name==null) {
125-
throw IllegalArgumentException("Null name found when building Person.")
125+
throw IllegalArgumentException(""${"\""}Null name found when building Person.""${"\""}.trimIndent())
126126
}
127127
if (age==null) {
128-
throw IllegalArgumentException("Null age found when building Person.")
128+
throw IllegalArgumentException(""${"\""}Null age found when building Person.""${"\""}.trimIndent())
129129
}
130130
return Person(name!!, nickname, age!!, veryLongAndVeryDetailedDescription)
131131
}

0 commit comments

Comments
 (0)