Does `ForbiddenImport` work for you? I turned it o...
# detekt
u
Does
ForbiddenImport
work for you? I turned it on now
Copy code
style:
	ForbiddenImport:
	    active: true
	    forbiddenImports:
	      - import: "java.time.*"
	        reason: "Use kotlinx.datetime instead"
and I'm getting 100s of
Copy code
Execution failed for task ':call-blocker:ui:detektDebug' (registered by plugin 'dev.detekt').
> java.lang.IllegalStateException:         Analyzing /Users/foo/AndroidStudioProjects/bar/call-blocker/ui/src/main/kotlin/com/foo/callblocker/ui/CallBlockRoleRequester.kt led to an exception.
          Location: java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:323)
          The original exception message was: dev.detekt.api.InvalidConfigurationError: Provided configuration file is invalid: Structure must be from type Map<String,Any>!
  null cannot be cast to non-null type kotlin.String
          Running detekt '2.0.0-alpha.3' on Java '25.0.3+9-LTS' on OS 'Mac OS X'
          If the exception message does not help, please feel free to create an issue on our GitHub page.
b
It works but instead of
- import: "java...
you need to use
- value: "java...
u
yes I figured it out thank you!