rocketraman
03/03/2022, 5:57 PMreturn (
foo
) as Something
which looks ugly compared to:
return (
foo
) as Something
rocketraman
03/05/2022, 12:30 AMeygraber
03/07/2022, 5:42 AMUtilityClassWithPublicConstructor
violation for:
expect abstract class PlatformComponent {
companion object
}
But with KMP it makes sense to have it.Eric
03/08/2022, 1:45 PMfun FooEntity.toWire(): Foo =
Foo.newBuilder()
.setLastSeenYearMonth(
PartialDate.newBuilder()
.setMonth(this.lastSeenMonth)
.setYear(this.lastSeenYear)
.build()
)
.build()
ktlint leaves that block as-is. detekt formats it like this:
fun FooEntity.toWire(): Foo =
Foo.newBuilder()
.setLastSeenYearMonth(
PartialDate.newBuilder()
.setMonth(this.lastSeenMonth)
.setYear(this.lastSeenYear)
.build()
)
.build()
and then flags the indentation as wrong and increases the debt score.Eric
03/08/2022, 10:30 PM// ktlint-disable
just after the package declaration, but that didn’t worktateisu
03/10/2022, 10:36 PMLuke
03/11/2022, 9:40 PMEric
03/14/2022, 3:43 PMmkrussel
03/15/2022, 4:11 PMdetektBaseline
task. It generated a detekt-baseline.xml
file, but when I run detekt
again, all the errors are reported. The warnings are from a custom Rule I created, so it is possible that there is something wrong with how I reported it.
It is suppressing some of the warnings but not all. I'm triggering warnings for all @property
tags in class documentation. The baseline includes all the ones found, but it is only suppressing the last one in a given class documentation block. This seems to be a bug.Brais Gabin
03/22/2022, 5:23 PMBrais Gabin
03/24/2022, 10:32 AMTim Oltjenbruns
03/26/2022, 12:38 PMdetektPlugins project(":carters-detekt")
and assembling my module before running detekt
• My META-INF seems to be set correctly src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider
But I’m getting this error io.gitlab.arturbosch.detekt.api.RuleSetProvider: Provider com.carters.retail.detekt.CartersRuleSetProvider not found
which is the exact
The package matches, the folder structure matches, the group matches. What other weirdness should I check that could be wrong?eygraber
03/27/2022, 4:49 PMsamp
03/28/2022, 2:26 PMBrais Gabin
03/30/2022, 8:26 PMCompose
if someone is looking for a side project 😛. They have them wrote for ktlint
but they can't open source it now.dimsuz
04/04/2022, 11:05 AMUnnecessaryParentheses
rule and it reported this code
offset.y.toInt() in item.offset..(item.offset + item.size)
Sure, technically those can be removed, but wouldn't it look less readable? Do you think this might be an exception or config option?
If yes, I can create issue and occasionally a PR.Tim Oltjenbruns
04/04/2022, 12:56 PMbindingContext.get(BindingContext.EXPRESSION_TYPE_INFO, expression)
So I’m wondering if it may be something specific to how Detekt acquires the BindingContext?eygraber
04/04/2022, 6:43 PMUnnecessaryLet
for 1.20?
I got a lot of violations in my project after updating to RC2. Most of them are related to using an "out" parameter, but I'm not sure if there's anything detekt can do there, and removing the let
isn't terrible.
There are some others, and I got one like this, and I'm not sure why it's unnecessary:
fun View.postHideKeyboard(shouldClearFocus: Boolean = false) {
if(shouldClearFocus) {
clearFocus()
}
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
rootView.windowToken.let { token -> <http://rootView.post|rootView.post> { imm.hideSoftInputFromWindow(token, 0) } }
}
Landry Norris
04/05/2022, 5:42 PMeygraber
04/11/2022, 8:52 PMCurtis Kroetsch
04/12/2022, 6:43 PMdix
04/18/2022, 5:44 PMjvmTarget
when attempting to upgrade to 1.20.0
? when I upgrade the version, now all my detekt tasks fail with Invalid value passed to --jvm-target
I've tried adding
tasks.withType(Detekt).configureEach {
jvmTarget = "1.8"
}
and that fails with Could not get unknown property 'Detekt'
Marcelo Hernandez
04/22/2022, 5:05 PMRedundantVisibilityModifierRule
rule?eygraber
04/24/2022, 2:40 PMSam
04/25/2022, 10:19 AMgammax
04/25/2022, 8:27 PM--input
arg. More on this here https://detekt.dev/docs/gettingstarted/git-pre-commit-hookeygraber
04/26/2022, 2:53 AMAn Tran
04/26/2022, 3:25 AMeygraber
05/01/2022, 6:15 AMdetektJvmMain
I get the following warning:
Execution optimizations have been disabled for task ':samples:kotlin-inject:detektJvmMain' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/home/eli/workspace/portal/samples/kotlin-inject/build/generated/ksp/jvm/jvmMain/kotlin'. Reason: Task ':samples:kotlin-inject:detektJvmMain' uses this output of task ':samples:kotlin-inject:kspKotlinJvm' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to <https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency> for more details about this problem.
warning: classpath entry points to a non-existent location: /home/eli/workspace/portal/samples/kotlin-inject/build/generated/ksp/metadata/jvmMain/kotlin
I exclude generated ksp files from detekt using:
tasks.withType<Detekt>().configureEach {
exclude {
"/build/generated/ksp" in it.file.absolutePath
}
}
dimsuz
05/04/2022, 5:15 PMsrc/main/resources/config/config.yml
• published to maven local
• In a sample project added `detektPlugins("com.examplemy ruleset1.0.0")
• In the config/config.yml
set rules as active:true
• didn't add anything to sample project's detekt-config.yml
Result: rule set is not applied.
but if I add in sample's `detekt-config.yml`:
compose:
MyRule:
active: true
Then rule gets applied and reports errors.
Did I miss something?