Merge pull request #11301 from tamasvajk/kotlin-naming-ref-type

Kotlin: Exclude .kt files from misnamed reftype query
This commit is contained in:
Tamás Vajk
2022-11-16 16:22:40 +01:00
committed by GitHub
4 changed files with 14 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ import java
from RefType t
where
t.fromSource() and
t.getFile().isJavaSourceFile() and
not t instanceof AnonymousClass and
not t.getName().substring(0, 1).toUpperCase() = t.getName().substring(0, 1)
select t, "Class and interface names should start in uppercase."

View File

@@ -0,0 +1 @@
Advisory/Naming/NamingConventionsRefTypes.ql

View File

@@ -0,0 +1,12 @@
class Foo {
fun myFun() {
val nestedStr by lazy {
"another string"
}
fun nestedFun() {
}
}
}
class aaaa {}