fix: silence detekt multiplatform type-resolution compiler-error noise#17
Closed
rasros wants to merge 2 commits into
Closed
fix: silence detekt multiplatform type-resolution compiler-error noise#17rasros wants to merge 2 commits into
rasros wants to merge 2 commits into
Conversation
Contributor
Author
|
Closing: the fix would have disabled detekt's type-resolution tasks, which silently drops UnnecessaryFullyQualifiedName on KMP projects. The 'compiler errors found during analysis' notice is cosmetic (it doesn't disable the rule; only reduces accuracy on the few @Serializable/expect-actual files), and no detekt release (incl. 2.0.0-alpha.4) resolves the KMP analysis-compile gap. Leaving the warning in place rather than adding brittle fragment-args machinery to the shared plugin. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
detektMainJvm/detektTestJvm) incom.eignex.lint, gated on the Kotlin Multiplatform plugin.Why
On a Kotlin Multiplatform project, detekt's per-compilation type-resolution tasks compile every source set merged into a single module, without the kotlinx-serialization compiler plugin or the K2 fragment structure the real build uses. So
@Serializable(the synthetic.serializer()) andexpect/actualpairs resolve as errors, and detekt prints "N compiler errors found during analysis. This affects accuracy of reporting." The notice never fails the build, but it clutters output and degrades type-rule accuracy on exactly the files it can't resolve. This mirrors detekt's owndetekt.multiplatform.disabledproperty, which can't be set from a precompiled-script plugin.The per-source-set tasks (PSI-based) still enforce every rule this config enables, so multiplatform projects lose no active coverage. JVM-only projects are untouched — they have no expect/actual, and
UnnecessaryFullyQualifiedNamerelies on their correctly-resolved type-resolution tasks.Testing
./gradlew testgreen (incl. the JVMUnnecessaryFullyQualifiedName fails detektMaintest, confirming JVM type-resolution tasks are unaffected).detektMainJvmis disabled and:klause:checkruns clean with no "compiler errors found during analysis" notice.