Zac Sweers
09/24/2022, 6:58 PMeygraber
09/29/2022, 3:31 AMString.capitalize(Locale)
isn't deprecated, and the IDE doesn't warn me about deprecation, but detekt does.Sebastian Schuberth
09/30/2022, 11:19 AMSebastian Schuberth
09/30/2022, 4:53 PMjava.lang.StackOverflowError (no error message)
with 1.22.0-RC1?Endre Deak
09/30/2022, 5:45 PM> Run failed with 1 invalid config property.
- Property 'formatting' is misspelled or does not exist.
Colton Idle
10/03/2022, 1:31 AMdimsuz
10/03/2022, 3:45 PMdetektDebug
task doesn't work on my CI, because each module gets a NO-SOURCE
status:
Task :feature:catalog:ui:detektDebug NO-SOURCE
But this works and detects issues when I run the same detektDebug
task locally.
Any ideas what might cause this?
~UPD: Can this happen because I run detekt tasks on CI before anything gets compiled?~Nope, doesn't work after compile either.
UPD2: Looks like I have found the reason. Our CI builds use gradle remote cache, so all lines which have NO-SOURCE
, have something like this before them:
Task :feature:catalog:ui:compileDebugKotlin FROM-CACHE
And this causes detekt to not run any checks (although there are some failing).
Is this a known bug? Can't seem to find it right away on github.Vitaly Pinchuk
10/04/2022, 11:34 AMgenerateDocumentation
task? https://github.com/detekt/detekt/blob/59bedc9eeda131b404dda44330e5cf4645e81fa1/detekt-generator/build.gradle.kts#L46
file("${rootProject.rootDir}/detekt-generator/build/libs/detekt-generator-${Versions.DETEKT}-all.jar"),
Brais Gabin
10/05/2022, 7:20 AMhelp wanted
issues on our issue tracker so feel free to grab some and get that T-Shirt 😉Francesco Bonnì
10/11/2022, 9:39 AMnuhkoca
10/14/2022, 9:07 PMFirebase
events and I want to check whether or not the passed id
parameter exceeds 40 char limit. What function of a custom detekt rule(e.g. visitClassBody
) should I use?
Sample usages of different calls
So how can I access to the create
function and check its id
property?
interface FirebaseTrackingEvent : TrackingEvent {
companion object {
fun create(firebaseId: String, params: Map<String, Any> = emptyMap()): FirebaseTrackingEvent {
return FirebaseTrackingEventDataClass(firebaseId, params)
}
}
object SampleTrackingEvents {
val sampleEvent = FirebaseTrackingEvent.create(id = "sample_event_id_which_is_more_than_40_char")
fun sampleEvent1(tabIndex: Int): TrackingEvent {
return FirebaseTrackingEvent.create(
firebaseId = "sample_event_id_which_is_more_than_40_char",
params = mapOf("index" to tabIndex)
)
}
}
oleg_osipenko
10/16/2022, 8:12 AMBaselineProvider
to load all baselines from multiple modules, collect all findings and manually suppressed issues into two single sets and create new baseline from them, encapsulating all issues from individual files into one. When I would have stored this file somewhere locally and use it to pass to Detekt CLI.
But now I see that there is an intention to add a new finding into baseline. In current scenario it should modify provided baseline file. But as we supposed to have multiple config files it’s a question, which config file to update.
Any idea about this?Jan Skrasek
10/17/2022, 6:48 AMaherbel
10/20/2022, 2:58 PMAnouar di Kali
10/23/2022, 12:07 PMiamthevoid
10/26/2022, 6:56 AMRacka N
10/31/2022, 3:52 PMexclude("**/build/**", "**/generated/**", "**/resources/**")
for my Detekt
task it doesn't ignore any of these directories. My detekt setup: https://pastebin.com/Lf8xjHdneygraber
10/31/2022, 10:06 PMeygraber
11/02/2022, 10:07 PMdetektMain
on a project that has Gradle precompiled script plugins:
Front-end Internal error: Failed to analyze declaration Co_myapp_kotlin_multiplatform_gradle
File being compiled: (1,71) in //home/eli/workspace/myapp/src/main/kotlin/co.myapp-kotlin-multiplatform.gradle.kts
The root cause org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException was thrown at: org.jetbrains.kotlin.resolve.lazy.BasicAbsentDescriptorHandler.diagnoseDescriptorNotFound(AbsentDescriptorHandler.kt:18)
Is this a known issue, or should I file something in GitHub?mrclrchtr
11/03/2022, 1:47 PMjvmTarget = "1.8"
The problem is that now I want to use detektMain and detektTest, in these type resolution is enabled, but in detektBaselineMultiModule it is not.Anouar di Kali
11/03/2022, 4:39 PMExecution failed for task ':app:detekt'.
Run failed with 1 invalid config property.- Property 'formatting' is misspelled or does not exist.
Callum Seabrook
11/05/2022, 10:59 AMconfig
Gradle property, will it merge the configs together? Or will one override the other? I'm trying to find a way to have a common config with shared options and then separate configs for different modules with more specific settings and options, to avoid repeating myself everywhere.Thomas Hormes
11/09/2022, 4:35 PMdimsuz
11/11/2022, 2:34 PMwhen
on enums, e.g.
enum Variant { One, Two, Three }
// non-compliant
if (variant == Variant.One)
doStuff() else doOtherStuff()
// compliant
when (variant) {
One -> doStuff()
Two, Three -> doOtherStuff()
}
with rationale being that in the latter case if Four
would be added it's better to have the compiler tell you that you should think about how you would handle it in every place you depend on this enum.
But first I wanted to ask: is there something like this in Detekt's rule set already?eygraber
11/21/2022, 5:34 AMBrais Gabin
11/21/2022, 8:36 AMThrowable
with a data class
. Example data class Foo(val status: Int) : IllegalStateException()
. The reason is that any Throwable
stores information about were it was instantiated. For that reason the equals
that data class
implements is missleading. Two equal instances of Foo
have different behaviour. My question: do you know any source talking about this? Does a rule like this have sense to you?hfhbd
11/21/2022, 10:20 AMbod
11/21/2022, 10:57 AMvisitCallExpression(expression: KtCallExpression)
, trying to find calls to a specific extension function.
When calling expression.getResolvedCall(bindingContext)
on a regular function, I'm correctly getting the corresponding descriptor.
However, when the call is an extension function, this returns null
.
Any idea if there's a known limitation or another way to do this?Sebastian Schuberth
11/21/2022, 1:15 PM@Suppress("EnumEntryNameCase")
, is anyone else having that problem?simon.vergauwen
11/30/2022, 3:36 PMKtElement
hierarchy. Making it quite easy to inspect and find certain usages, I was wondering if there was something like "auto-fix" like KtLint auto-formatting I can leverage as well.
Otherwise, just finding certain usages and modifying the files is also an option 🤔