Comments (5)
reading #6198 more in detail, I tried this:
configurations.matching { it.name == "detekt" }.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion(io.gitlab.arturbosch.detekt.getSupportedKotlinVersion())
}
}
}
With that the project is fixed.
So instead of using configurations.all {
I should use configurations.matching { it.name == "detekt" }.all {
I think (maybe it's just me) the documentation on https://detekt.dev/docs/gettingstarted/gradle/#dependencies should be updated to precise that configuration as an example, or I need to learn how to read better.
Thanks anyway for your help, and for this project.
from detekt.
I think (maybe it's just me) the documentation on https://detekt.dev/docs/gettingstarted/gradle/#dependencies should be updated to precise that configuration as an example, or I need to learn how to read better.
Can you provide a PR fixing the documentation?
from detekt.
We don't want or need the Kotlin version to be overridden on all configurations. We just need the detekt
configuration to be left alone.
If you apply the config you've provided then you're overriding all configurations. That's having an impact on Kotlin itself which is what the warning is about.
There isn't much detekt can do about this directly. Your Gradle config needs to be fixed, or you need to stop the dependency plugin overriding the configs.
from detekt.
If you apply the config you've provided then you're overriding all configurations. That's having an impact on Kotlin itself which is what the warning is about.
But that is detekt official documentation https://detekt.dev/docs/gettingstarted/gradle/#dependencies, it's even in the logs of the warning.
There isn't much detekt can do about this directly. Your Gradle config needs to be fixed, or you need to stop the dependency plugin overriding the configs.
But below Kotlin 2.0.0 this was working, so, what is the official way to do it now? The only real change in my gradle configuration is kotlin from 1.9.4 to 2.0.0.
And stopping the dependency plugin to override the configs is like stopping using spring, that is not an option. There is a full discussion of this #6198 (still open).
But the main problem with this is that you used to have a workaround with kotlin versions lower than 2.0.0 described in your own configuration, which is not working anymore.
from detekt.
Related Issues (20)
- MatchingDeclarationName - Not detecting method names - Jetpack Compose HOT 10
- The issue arises when I move the detekt-baseline.xml file from its default path (project/app/detekt-baseline.xml) to a new location (project/config/detekt/detekt-baseline.xml). HOT 3
- MissingPackageDeclaration - Incorrect issue reported. HOT 1
- Add 2.0.0 language version compatibility to detekt-compiler-plugin HOT 3
- Remove deprecated configuration items HOT 5
- autoCorrect not working without "buildUponDefaultConfig = true" HOT 3
- Kotlin 2.0.0: `RuleExtensionsKt.compileAndLintWithContext` fails with `NoScopeRecordCliBindingTrace: method <init>()V not found` HOT 2
- Unable to setup `CoroutineLaunchedInTestWithoutRunTest` rule HOT 4
- False positive on CanBeNonNullable: method with multiple nullables HOT 4
- Forbidden parameter name
- False positive for UnnecessaryParentheses in require + in
- UnusedImport reported for import org.gradle.kotlin.dsl.assign in kotlin-dsl HOT 1
- JVM Target 22 is not supported by detekt HOT 1
- Support State<Boolean> and Flow<Boolean> for NonBooleanPropertyPrefixedWithIs. HOT 2
- Consider honoring `PropertyName` HOT 3
- Can't suppress the Deprecation rule due to reference in import HOT 5
- Move from `KtFile` to `FirFile` HOT 2
- Support `FirAdditionalCheckersExtension`
- ClassOrdering rule prints incorrect message
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detekt.