Kotlin: Enable java/misnamed-type query

We used to get alerts for the class around a local function, a lambda,
or a function reference, which we give name "". Now those are marked as
compiler-generated, and the query ignores compiler-generated types.
This commit is contained in:
Ian Lynagh
2022-11-25 16:27:45 +00:00
parent 3c7f7511be
commit a423f5f695
5 changed files with 11 additions and 1 deletions

View File

@@ -12,7 +12,8 @@ import java
from RefType t
where
t.getFile().isJavaSourceFile() and
t.fromSource() and
not t instanceof AnonymousClass and
not t.isCompilerGenerated() 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,4 @@
---
category: minorAnalysis
---
* The query `java/misnamed-type` is now enabled for Kotlin.