Kotlin: exclude Kotlin source from 'inner class could be static' check

This commit is contained in:
Tamas Vajk
2022-05-13 11:20:28 +02:00
parent cd17e2eb28
commit 631ba8adcf
2 changed files with 3 additions and 2 deletions

View File

@@ -130,7 +130,9 @@ predicate potentiallyStatic(InnerClass c) {
)
) and
// JUnit Nested test classes are required to be non-static.
not c.hasAnnotation("org.junit.jupiter.api", "Nested")
not c.hasAnnotation("org.junit.jupiter.api", "Nested") and
// There's no `static` in kotlin:
not c.getLocation().getFile().isKotlinSourceFile()
}
/**

View File

@@ -1 +0,0 @@
| Test.kt:3:5:5:5 | Companion | Companion should be made static, since the enclosing instance is not used. |