ktlint errors
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{kt,kts}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
|
||||
ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^
|
||||
ij_kotlin_name_count_to_use_star_import = 2147483647
|
||||
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
|
||||
ij_kotlin_packages_to_use_import_on_demand = unset
|
||||
|
||||
+7
-5
@@ -194,9 +194,11 @@ class PowerAssertCallTransformer(
|
||||
if (values.isEmpty()) return emptyList()
|
||||
|
||||
// Java static functions require searching by class
|
||||
val parentClassFunctions = (function.parentClassOrNull
|
||||
?.let { context.referenceClass(it.kotlinFqName) }
|
||||
?.functions ?: emptySequence())
|
||||
val parentClassFunctions = (
|
||||
function.parentClassOrNull
|
||||
?.let { context.referenceClass(it.kotlinFqName) }
|
||||
?.functions ?: emptySequence()
|
||||
)
|
||||
.filter { it.owner.kotlinFqName == function.kotlinFqName }
|
||||
.toList()
|
||||
val possible = (context.referenceFunctions(function.kotlinFqName) + parentClassFunctions)
|
||||
@@ -226,8 +228,8 @@ class PowerAssertCallTransformer(
|
||||
|
||||
private fun isStringJavaSupplierFunction(type: IrType): Boolean {
|
||||
val javaSupplier = context.referenceClass(FqName("java.util.function.Supplier"))
|
||||
return javaSupplier != null && type.isSubtypeOfClass(javaSupplier)
|
||||
&& type is IrSimpleType && (type.arguments.size == 1 && isStringSupertype(type.arguments.first()))
|
||||
return javaSupplier != null && type.isSubtypeOfClass(javaSupplier) &&
|
||||
type is IrSimpleType && (type.arguments.size == 1 && isStringSupertype(type.arguments.first()))
|
||||
}
|
||||
|
||||
private fun isStringSupertype(argument: IrTypeArgument): Boolean =
|
||||
|
||||
-1
@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.ir.builders.irCall
|
||||
import org.jetbrains.kotlin.ir.builders.parent
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.ir.declarations.IrVariable
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package com.bnorm.power
|
||||
|
||||
import kotlin.test.Test
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import kotlin.test.Test
|
||||
|
||||
class AssertTest {
|
||||
@Test
|
||||
@@ -86,11 +86,11 @@ fun main() {
|
||||
assert(1 == 2, lambda)
|
||||
}""",
|
||||
"""
|
||||
Not equal
|
||||
assert(1 == 2, lambda)
|
||||
|
|
||||
false
|
||||
""".trimIndent()
|
||||
Not equal
|
||||
assert(1 == 2, lambda)
|
||||
|
|
||||
false
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package com.bnorm.power
|
||||
|
||||
import kotlin.test.Test
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import kotlin.test.Test
|
||||
|
||||
class Junit5AssertionsTest {
|
||||
@Test
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package com.bnorm.power
|
||||
|
||||
import kotlin.test.Test
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import kotlin.test.Test
|
||||
|
||||
class KotlinTestAssertTest {
|
||||
@Test
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package com.bnorm.power
|
||||
|
||||
import kotlin.test.Test
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import kotlin.test.Test
|
||||
|
||||
class LamdaTest {
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user