Merge pull request #11303 from tamasvajk/kotlin-one-stmt-line

Kotlin: Exclude .kt files from one stmt in line query
This commit is contained in:
Tamás Vajk
2022-11-16 17:02:35 +01:00
committed by GitHub
4 changed files with 9 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ predicate oneLineStatement(Stmt s, File f, int line, int col) {
from Stmt s, Stmt s2
where
exists(File f, int line, int col, int col2 |
f.isJavaSourceFile() and
oneLineStatement(s, f, line, col) and
oneLineStatement(s2, f, line, col2) and
col < col2 and

View File

@@ -0,0 +1 @@
Advisory/Statements/OneStatementPerLine.ql

View File

@@ -0,0 +1,7 @@
class Foo {
fun foo(): Foo { return this }
fun bar(x: Foo?): Foo? {
return x?.foo()
}
}