Skip to content

Commit ad7c0f9

Browse files
authored
Merge pull request github#11301 from tamasvajk/kotlin-naming-ref-type
Kotlin: Exclude .kt files from misnamed reftype query
2 parents a3ff835 + c1be93a commit ad7c0f9

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

java/ql/src/Advisory/Naming/NamingConventionsRefTypes.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import java
1212

1313
from RefType t
1414
where
15-
t.fromSource() and
15+
t.getFile().isJavaSourceFile() and
1616
not t instanceof AnonymousClass and
1717
not t.getName().substring(0, 1).toUpperCase() = t.getName().substring(0, 1)
1818
select t, "Class and interface names should start in uppercase."

java/ql/test/kotlin/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.expected

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Advisory/Naming/NamingConventionsRefTypes.ql
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Foo {
2+
fun myFun() {
3+
val nestedStr by lazy {
4+
"another string"
5+
}
6+
7+
fun nestedFun() {
8+
}
9+
}
10+
}
11+
12+
class aaaa {}

0 commit comments

Comments
 (0)