Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce "analysis mode" flag to CLI #7173

Open
3flex opened this issue Apr 12, 2024 · 0 comments
Open

Introduce "analysis mode" flag to CLI #7173

3flex opened this issue Apr 12, 2024 · 0 comments

Comments

@3flex
Copy link
Member

3flex commented Apr 12, 2024

Expected Behavior

I can use rules that use type resolution without passing a classpath explicitly.

Current Behavior

Type resolution is only enabled when a classpath is passed in.

Context

detekt assumes that if no classpath is passed in, that type resolution & full analysis isn't possible. This isn't true though - we call configureJdkClasspathRoots unconditionally:
https://github.com/JetBrains/kotlin/blob/v1.9.23/compiler/cli/cli-base/src/org/jetbrains/kotlin/cli/jvm/config/JvmContentRoots.kt#L91-L103

It's possible to have a module that has no Kotlin dependencies at all, but depends on the JRE, or it might not have any dependencies at all. This is rare but detekt should properly handle this.

We could have a switch or flag to enable or disable full analysis mode so the intention is clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant