Venkat , Bangalore , India
09/14/2020, 3:18 PMgabrielfv
09/16/2020, 11:22 PMType?.extForNullable()
I want to identify in a rule if this method is called, and not a version of it exclusive for a non-null instance of Type
, or a more specialized version of it, like SpecificType?.extForNullable()
, even if SpecificType : Type
.
I’m trying to visit dot-qualified expressions, since if I go for a safe expression I’m not calling a nullable version any way, but idk how to follow from hereDaniel Svensson
09/22/2020, 8:26 AM-Werror=...
etc I was hoping to convince detekt to error out if there are any: unused variables, unused methods, useless foo?.bar
etc, but I can't seem to find it in the configuration. Am I missing something?Marcelo Hernandez
09/24/2020, 6:47 PMFlow<T>
(including subclasses) in visitNamedFunction
. I am new to the APIs in kotlin-compiler-embeddable
.
I am trying to use:
bindingContext[BindingContext.FUNCTION, function].returnType
but that seems to resolve to an UnresolvedType
. I have also tried
function.getResolvedCall(bindingContext)
but that always returns null
. Is there any way to resolve types that are not considered built-in?karandeep singh
09/25/2020, 8:32 AMthemishkun
09/26/2020, 10:00 AMrobstoll
10/01/2020, 5:19 AMCould not find io.gitlab.arturbosch.detekt:detekt-bom:1.14.1.
Searched in the following locations:
- <https://plugins.gradle.org/m2/io/gitlab/arturbosch/detekt/detekt-bom/1.14.1/detekt-bom-1.14.1.pom>
- <https://repo.maven.apache.org/maven2/io/gitlab/arturbosch/detekt/detekt-bom/1.14.1/detekt-bom-1.14.1.pom>
- <https://jcenter.bintray.com/io/gitlab/arturbosch/detekt/detekt-bom/1.14.1/detekt-bom-1.14.1.pom>
is this version not yet published?BorzdeG
10/06/2020, 5:56 PM1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':myproject:detekt'.
> Could not resolve all files for configuration ':myproject:detekt'.
> Could not resolve org.jetbrains.kotlinx:kotlinx-html-jvm.
Required by:
project :myproject > io.gitlab.arturbosch.detekt:detekt-cli:1.14.1 > io.gitlab.arturbosch.detekt:detekt-bom:1.14.1
> Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- jvm-api
- jvm-runtime
- metadata-api
All of them match the consumer attributes:
- Variant 'jvm-api' capability org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- Unmatched attributes:
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-api' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'jvm-runtime' capability org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- Unmatched attributes:
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'metadata-api' capability org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- Unmatched attributes:
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'kotlin-api' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'common' but the consumer didn't ask for it
> Could not resolve org.jetbrains.kotlinx:kotlinx-html-jvm.
Required by:
project :myproject > io.gitlab.arturbosch.detekt:detekt-cli:1.14.1 > io.gitlab.arturbosch.detekt:detekt-core:1.14.1 > io.gitlab.arturbosch.detekt:detekt-report-html:1.14.1
> Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- jvm-api
- jvm-runtime
- metadata-api
All of them match the consumer attributes:
- Variant 'jvm-api' capability org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- Unmatched attributes:
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-api' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'jvm-runtime' capability org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- Unmatched attributes:
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'metadata-api' capability org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2:
- Unmatched attributes:
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'kotlin-api' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'common' but the consumer didn't ask for it
Jiddles
10/09/2020, 10:11 AMfo2rist
10/14/2020, 10:30 PMsanogueralorenzo
10/28/2020, 11:27 AMmjthornton
10/30/2020, 7:05 PMLilly
11/02/2020, 1:45 PMtasks.register<Detekt>("detektAll") {
setSource(projectDir)
buildUponDefaultConfig = true
config.setFrom(configFile)
parallel = true
debug = true
reports {
xml.enabled = false
html.enabled = false
txt.enabled = false
}
include("**/*.kt")
include("**/*.kts")
exclude("resources/")
exclude("build/")
}
I run the task with gradlew detektAll
. Why does it log the output to console in first run but not in second run?
Edit: ok got it. I had set the maxIssues to 30, now it's 0 again. Same code different question: my task does not show the formatting
rule set from the formatting
plugin while detekt
does. Did I miss something.
Edit2: ok got second issue too. I had to add
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.14.2")
}
to my root build.gradle.kts, not to my sub projects build script.
Edit3: correction: I have to add it to root build script and sub projects build script aswellLilly
11/02/2020, 3:31 PMdetekt
task, it complains about SpreadOperator
. The docs state:
When type resolution is enabled in detekt this case will not be flagged by the rule since it doesn’t suffer the performance penalty of an array copy.Does it mean
detekt
shouldn't detect that issue?mjthornton
11/05/2020, 5:39 PM@Test
fun `TOFUBRuleTest() Test`(){
TOFUBRule().lint("$kDOCTestString")
}
spand
11/16/2020, 10:35 AMJakub Chrzanowski
11/22/2020, 10:38 PMdetekt
Gradle task directly, it prints output with proper colors, but when run via check
task, I get something like:
> Task :detekt FAILED
formatting - 5min debt
[33mNoConsecutiveBlankLines - [] at /Users/hsz/Projects/JetBrains/intellij-plugin-template/src/main/kotlin/org/jetbrains/plugins/template/services/MyProjectService.kt:3:1[0m
Overall debt: 5min
Sourabh Rawat
11/25/2020, 9:15 AMCaused by: org.gradle.api.GradleException: Error resolving plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.3.61']
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:207)
... 155 more
Caused by: org.gradle.plugin.management.internal.InvalidPluginRequestException: Plugin request for plugin already on the classpath must not include a version
Javier
12/02/2020, 11:31 AMdata class
in a single line which ends with a trailing comma, using the detekt plugin to format it, the format keeps. But it should be changing to multiline (or at least delete the trailing comma, but with a strict mode I think it should be converted to multiline).
Another example is can be:
fun something() = "something"
fun something() =
"something"
The second one clearly should be reformated to the first one because it fits de space, but like both approach are valid, it doesn't get reformat
I love a lot how the reformat works in Dart/Flutter because it forces A LOT how the code should look. Overall about spacing and playing with trailing comma to reformat from single line (or a "broken multiline") to multiline that looks goodSebastian Schuberth
12/07/2020, 5:03 PMthemishkun
12/17/2020, 11:06 AMdetektMain
command, I keep getting the same error about detekt not being able to choose kotlinx-html dependency.
Like that
Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2
Any tips on this?
Full exception message can be found here
https://pastebin.com/uPHFNVtB
Thank in advancethemishkun
12/17/2020, 3:02 PMUnusedImport
rule? Since type resolution does not work with kotlin synthetics, and our project is full of them, this rule give me 1k+ false-positivesBrais Gabin
12/24/2020, 9:26 AMSebastian Schuberth
01/05/2021, 1:52 PMvisitPackageDirective
function?taso
01/08/2021, 5:20 PMMarcelo Hernandez
02/04/2021, 12:03 AMBig Chungus
02/07/2021, 6:44 PMJavier
02/08/2021, 9:26 AMignoreFailures = true
and I tried isIgnoreFailures = true
too. Nothing works. This was working for me some months ago.Sebastian Schuberth
02/09/2021, 1:28 PM+=
instead of .add()
, in
instead of .contains()
etc? So far I wasn't able to find one.gammax
02/09/2021, 7:35 PMgammax
02/09/2021, 7:35 PMchao
02/09/2021, 8:01 PM<https://github.com/Kotlin/kmm-sample>
used to evaluate the PR? I can try with the official sample firstgammax
02/09/2021, 8:01 PMchao
02/09/2021, 8:02 PMgammax
02/09/2021, 8:03 PMchao
02/09/2021, 8:03 PMBrais Gabin
02/09/2021, 8:07 PMseb
02/10/2021, 8:40 AMgammax
02/10/2021, 8:41 AMchao
02/11/2021, 11:16 PMgammax
02/11/2021, 11:18 PMchao
02/11/2021, 11:23 PM