Merge pull request #3371 from element-hq/renovate/com.lemonappdev-konsist-0.x
Update dependency com.lemonappdev:konsist to v0.16.1
This commit is contained in:
commit
e52c7eea12
3 changed files with 18 additions and 3 deletions
|
|
@ -139,7 +139,7 @@ test_arch_core = "androidx.arch.core:core-testing:2.2.0"
|
|||
test_junit = "junit:junit:4.13.2"
|
||||
test_runner = "androidx.test:runner:1.6.2"
|
||||
test_mockk = "io.mockk:mockk:1.13.12"
|
||||
test_konsist = "com.lemonappdev:konsist:0.15.1"
|
||||
test_konsist = "com.lemonappdev:konsist:0.16.1"
|
||||
test_turbine = "app.cash.turbine:turbine:1.1.0"
|
||||
test_truth = "com.google.truth:truth:1.4.4"
|
||||
test_parameter_injector = "com.google.testparameterinjector:test-parameter-injector:1.17"
|
||||
|
|
|
|||
|
|
@ -82,7 +82,15 @@ class KonsistArchitectureTest {
|
|||
return@all if (type.startsWith("@") || type.startsWith("(") || type.startsWith("suspend")) {
|
||||
true
|
||||
} else {
|
||||
val fullyQualifiedName = param.type.declaration.packagee?.fullyQualifiedName + "." + type
|
||||
var typePackage = param.type.declaration.packagee?.name
|
||||
if (typePackage == type) {
|
||||
// Workaround, now that packagee.fullyQualifiedName is not available anymore
|
||||
// It seems that when the type in in the same package as the function,
|
||||
// the package is equal to the type (which is wrong).
|
||||
// So in this case, use the package of the function
|
||||
typePackage = it.packagee?.name
|
||||
}
|
||||
val fullyQualifiedName = "$typePackage.$type"
|
||||
fullyQualifiedName !in forbiddenInterfacesForComposableParameter
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,14 @@ class KonsistClassNameTest {
|
|||
.replace("FakeRust", "")
|
||||
.replace("Fake", "")
|
||||
(it.name.startsWith("Fake") || it.name.startsWith("FakeRust")) &&
|
||||
it.parents().any { parent -> parent.name.replace(".", "") == interfaceName }
|
||||
it.parents().any { parent ->
|
||||
// Workaround to get the parent name. For instance:
|
||||
// parent.name used to return `UserListPresenter.Factory` but is now returning `Factory`.
|
||||
// So we need to retrieve the name of the parent class differently.
|
||||
val packageName = parent.packagee!!.name
|
||||
val parentName = parent.fullyQualifiedName!!.substringAfter("$packageName.").replace(".", "")
|
||||
parentName == interfaceName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue