Skip to content

Commit deaf912

Browse files
committed
Kotlin: Add an integration test for extractor information
1 parent c67cc23 commit deaf912

File tree

6 files changed

+27
-1
lines changed

6 files changed

+27
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| Number of files with extension jar | 1 |
2+
| Number of files with extension kt | 1 |
3+
| Number of lines of code | 2 |
4+
| Number of lines of code with extension kt | 2 |
5+
| Total number of lines | 3 |
6+
| Total number of lines with extension kt | 3 |
7+
| Uses Kotlin 2: false | 1 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/java-queries
4+
extensible: extractorInformationSkipKey
5+
data:
6+
# These will have unstable values, as they are dependent on the
7+
# JDK that the test is run with, so filter them out:
8+
- ["Number of files"]
9+
- ["Number of files with extension class"]
10+
# These depend on the Kotlin version you have installed
11+
- ["Kotlin Compiler Version: %"]
12+
- ["Kotlin Extractor Name: %"]
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Telemetry/ExtractorInformation.ql
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class SomeClass {
2+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from create_database_utils import *
2+
3+
run_codeql_database_create(["kotlinc SomeClass.kt"], lang="java")

java/ql/src/Telemetry/ExtractorInformation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ predicate extractorTotalDiagnostics(string key, int value) {
8787

8888
from string key, int value
8989
where
90-
not extractorInformationSkipKey(key) and
90+
not exists(string pattern | extractorInformationSkipKey(pattern) and key.matches(pattern)) and
9191
(
9292
compilationInfo(key, value) or
9393
fileCount(key, value) or

0 commit comments

Comments
 (0)