Skip to content

Commit 7ea4eca

Browse files
Update dependency com.pinterest.ktlint:ktlint-cli to v1.3.0 (#1853)
* Update dependency com.pinterest.ktlint:ktlint-cli to v1.3.0 * Disable expression rule * Reformat * Whatever --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jake Wharton <jw@squareup.com>
1 parent 807934f commit 7ea4eca

File tree

15 files changed

+46
-22
lines changed

15 files changed

+46
-22
lines changed

build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ spotless {
5757
}
5858
kotlin {
5959
ktlint(libs.ktlint.get().version).editorConfigOverride(
60-
mapOf("ktlint_standard_filename" to "disabled"),
60+
mapOf(
61+
"ktlint_standard_filename" to "disabled",
62+
// Making something an expression body should be a choice around readability.
63+
"ktlint_standard_function-expression-body" to "disabled",
64+
),
6165
)
6266
target("**/*.kt")
6367
trimTrailingWhitespace()

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ kotlinCompileTesting = { module = "dev.zacsweers.kctfork:core", version.ref = "k
3737
kotlinCompileTesting-ksp = { module = "dev.zacsweers.kctfork:ksp", version.ref ="kotlinCompileTesting" }
3838
truth = "com.google.truth:truth:1.4.2"
3939
googleJavaFormat = "com.google.googlejavaformat:google-java-format:1.22.0"
40-
ktlint = "com.pinterest.ktlint:ktlint-cli:1.2.1"
40+
ktlint = "com.pinterest.ktlint:ktlint-cli:1.3.0"

moshi-kotlin-codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/AdapterGenerator.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,20 +774,24 @@ private sealed class FromJsonComponent {
774774

775775
data class ParameterOnly(
776776
override val parameter: TargetParameter,
777-
) : FromJsonComponent(), ParameterComponent {
777+
) : FromJsonComponent(),
778+
ParameterComponent {
778779
override val type: TypeName = parameter.type
779780
}
780781

781782
data class PropertyOnly(
782783
override val property: PropertyGenerator,
783-
) : FromJsonComponent(), PropertyComponent {
784+
) : FromJsonComponent(),
785+
PropertyComponent {
784786
override val type: TypeName = property.target.type
785787
}
786788

787789
data class ParameterProperty(
788790
override val parameter: TargetParameter,
789791
override val property: PropertyGenerator,
790-
) : FromJsonComponent(), ParameterComponent, PropertyComponent {
792+
) : FromJsonComponent(),
793+
ParameterComponent,
794+
PropertyComponent {
791795
override val type: TypeName = parameter.type
792796
}
793797
}

moshi-kotlin-codegen/src/main/java/com/squareup/moshi/kotlin/codegen/ksp/shadedUtil.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ internal fun Resolver.getClassDeclarationByName(name: String): KSClassDeclaratio
4343

4444
internal fun <T : Annotation> KSAnnotated.getAnnotationsByType(annotationKClass: KClass<T>): Sequence<T> {
4545
return this.annotations.filter {
46-
it.shortName.getShortName() == annotationKClass.simpleName && it.annotationType.resolve().declaration
47-
.qualifiedName?.asString() == annotationKClass.qualifiedName
46+
it.shortName.getShortName() == annotationKClass.simpleName &&
47+
it.annotationType.resolve().declaration
48+
.qualifiedName?.asString() == annotationKClass.qualifiedName
4849
}.map { it.toAnnotation(annotationKClass.java) }
4950
}
5051

moshi-kotlin-tests/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ enum class TestMode {
1313
}
1414

1515
val testMode =
16-
findProperty("kotlinTestMode")?.toString()
16+
findProperty("kotlinTestMode")
17+
?.toString()
1718
?.let(TestMode::valueOf)
1819
?: REFLECT
1920

moshi-kotlin-tests/codegen-only/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ enum class TestMode {
1313
}
1414

1515
val testMode =
16-
findProperty("kotlinTestMode")?.toString()
16+
findProperty("kotlinTestMode")
17+
?.toString()
1718
?.let(TestMode::valueOf)
1819
?: KSP
1920

moshi-kotlin-tests/codegen-only/src/test/kotlin/com/squareup/moshi/kotlin/codegen/ComplexGenericsInheritanceTest.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ abstract class Layer1<A> {
134134
var layer1: A? = null
135135
}
136136

137-
abstract class Layer2<B> : Layer1<B>(), LayerInterface<B> {
137+
abstract class Layer2<B> :
138+
Layer1<B>(),
139+
LayerInterface<B> {
138140
var layer2: B? = null
139141
}
140142

@@ -147,4 +149,5 @@ abstract class Layer3<C, D> : Layer2<D>() {
147149
data class Layer4<E : Personable, F>(
148150
val layer4E: E,
149151
val layer4F: F? = null,
150-
) : Layer3<List<Int>, String>(), LayerInterface<String>
152+
) : Layer3<List<Int>, String>(),
153+
LayerInterface<String>

moshi-kotlin-tests/codegen-only/src/test/kotlin/com/squareup/moshi/kotlin/codegen/MoshiKspTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ class MoshiKspTest {
4444
// NOTE the Any() superclass is important to test that we're detecting the farthest parent class
4545
// correct.y
4646
@JsonClass(generateAdapter = true)
47-
data class SimpleImpl(override val a: String, val b: String) : Any(), SimpleInterface
47+
data class SimpleImpl(override val a: String, val b: String) :
48+
Any(),
49+
SimpleInterface
4850
}

moshi-kotlin/src/main/java/com/squareup/moshi/KotlinJsonAdapterFactory.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
2121
message = "this moved to avoid a package name conflict in the Java Platform Module System.",
2222
replaceWith = ReplaceWith("com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory"),
2323
)
24-
public class KotlinJsonAdapterFactory :
25-
JsonAdapter.Factory by KotlinJsonAdapterFactory()
24+
public class KotlinJsonAdapterFactory : JsonAdapter.Factory by KotlinJsonAdapterFactory()

moshi/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ tasks.withType<Test>().configureEach {
6363
jvmArgs("--add-opens=java.base/java.io=ALL-UNNAMED")
6464
}
6565

66-
tasks.withType<KotlinCompile>()
66+
tasks
67+
.withType<KotlinCompile>()
6768
.configureEach {
6869
compilerOptions {
6970
freeCompilerArgs.addAll(

0 commit comments

Comments
 (0)