- Notifications
You must be signed in to change notification settings - Fork173
Open
Description
Code: Modified avoid AvoidDateDetector.kt
overridefungetApplicableConstructorTypes():List<String>=listOf("com.google.gson.Gson")overridefunvisitConstructor(context:JavaContext,node:UCallExpression,constructor:PsiMethod, ) { context.report(ISSUE, node, context.getLocation(node),"Don't use `Gson`;", ) }
Test
funtestDocumentationExample() { lint() .files( kotlin(""" package test.pkg import com.google.gson.Gson fun test() { val gson = Gson() }""" ) .indented(), ) .allowCompilationErrors() .run() .expectErrorCount(1) }
Result
./gradlew lintis detecting this but test can't and the above test fails
Metadata
Metadata
Assignees
Labels
No labels