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
Support Kotlin 1.4 #2981
Support Kotlin 1.4 #2981
Conversation
bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, it] !in referenceDescriptors | ||
val referenceDescriptors = (references + referencesViaOperator) | ||
.mapNotNull { it.getResolvedCall(bindingContext)?.resultingDescriptor } | ||
.map { it.original } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resulting descriptors are not the same reference-wise. So I had to unwrap them in Kotlin 1.4.
bcd8a02
to
e8aa819
Compare
I'm not sure how to resolve this Gradle warning:
Including |
Codecov Report
@@ Coverage Diff @@
## master #2981 +/- ##
============================================
- Coverage 80.31% 79.77% -0.55%
- Complexity 2477 2493 +16
============================================
Files 424 424
Lines 7478 7490 +12
Branches 1369 1409 +40
============================================
- Hits 6006 5975 -31
- Misses 760 768 +8
- Partials 712 747 +35
Continue to review full report at Codecov.
|
Really strange... The 1.3.72 version doesn't appear at |
It's the Kotlin version |
detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/runners/VersionPrinterSpec.kt
Show resolved
Hide resolved
I would say lets merge this with the warning so our users have a working detekt version for Kotlin 1.4 if they do not use formatting to much. |
Kotlin 1.4 is smoke-tested currently in gradle/gradle#12660 and - with some luck - available with Gradle 6.7 - if Gradle does not decide to skip this upgrade until Gradle 7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.resolve.lazy.declarations.FileBasedDeclarationProvid | |||
internal fun generateBindingContext( | |||
environment: KotlinCoreEnvironment, | |||
classpath: List<String>, | |||
files: List<KtFile> | |||
files: List<KtFile>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Out of interest - we can have trailing commas now, but why should we have them here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like IntelliJ autoformatted them for me here :/. Wasn't aware of.
README.md
Outdated
@@ -63,7 +63,7 @@ You can find [other ways to install detekt here](https://detekt.github.io/detekt | |||
|
|||
#### with Gradle | |||
|
|||
Gradle 5.0+ is required: | |||
Gradle 5.3+ is required: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this changed to reflect the new minimum Gradle version required by Kotlin? If so....
Gradle 5.3+ is required: | |
Gradle 5.4+ is required: |
https://kotlinlang.org/docs/reference/using-gradle.html#plugin-and-versions:
The Kotlin Gradle plugin 1.4.0 works with Gradle 5.4 and later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! It works with 5.3 and running it with 5.0 revealed an error message saying it supports Gradle 5.3+.
But lets follow the website's info ^^
@@ -29,9 +29,9 @@ object MultiVersionTest : Spek({ | |||
|
|||
private fun getGradleVersionsUnderTest() = | |||
if (getJdkVersion() < 13) { | |||
listOf("5.0", "6.4.1") | |||
listOf("5.3", "6.6") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listOf("5.3", "6.6") | |
listOf("5.4", "6.6") |
This was removed in detekt#2981 for an issue with kotlin 1.4 but that issue is fixed now so it's safe to enable it again
This was removed in detekt#2981 for an issue with kotlin 1.4 but that issue is fixed now so it's safe to enable it again
This was removed in detekt#2981 for an issue with kotlin 1.4 but that issue is fixed now so it's safe to enable it again
* Deprecate Location.file in favor of Location.filePath * Fix warnings * Enable warningsAsErrors again This was removed in #2981 for an issue with kotlin 1.4 but that issue is fixed now so it's safe to enable it again
* Deprecate Location.file in favor of Location.filePath * Fix warnings * Enable warningsAsErrors again This was removed in detekt#2981 for an issue with kotlin 1.4 but that issue is fixed now so it's safe to enable it again
Closes #2974