elinka
01/12/2024, 12:21 PMDavid Kubecka
01/24/2024, 1:26 PMintellij_idea
to ktlint_official
and would like to know upfront which changes I should be expecting to make.slack
01/27/2024, 11:27 AMjava.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at io.github.oshai.kotlinlogging.slf4j.internal.Slf4jLoggerFactory.jLogger$kotlin_logging(Slf4jLoggerFactory.kt:11)
at io.github.oshai.kotlinlogging.internal.KLoggerFactory.logger$kotlin_logging(KLoggerFactory.kt:16)
at io.github.oshai.kotlinlogging.KotlinLogging.logger(KotlinLogging.kt:23)
at io.github.oshai.kotlinlogging.KotlinLogging.logger(KotlinLogging.kt:13)
at com.pinterest.ktlint.test.KtLintAssertThatKt.<clinit>(KtLintAssertThat.kt:36)
at com.pinterest.ktlint.test.KtLintAssertThatAssertable.createKtLintRuleEngine(KtLintAssertThat.kt:685)
at com.pinterest.ktlint.test.KtLintAssertThatAssertable.lint(KtLintAssertThat.kt:696)
at com.pinterest.ktlint.test.KtLintAssertThatAssertable.hasNoLintViolations(KtLintAssertThat.kt:439)
at com.pinterest.ktlint.test.KtLintAssertThat.hasNoLintViolations(KtLintAssertThat.kt:231)
at com.adidas.confirmed.rules.MviViewModelRuleTest.lint class that implements MviHost and has no other public methods or properties should pass(MviViewModelRuleTest.kt:24)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:112)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
I already tried to include all ktlint dependencies, slf4j, but no success.
This is how my build.gradle.kts looks like now:
dependencies {
implementation(externalLib.ktlintCli)
implementation(externalLib.ktlintRuleEngineCore)
implementation(externalLib.ktlintRuleEngine)
implementation(externalLib.ktlintLogger)
// Test Libraries
testImplementation(externalLib.junit)
testImplementation(externalLib.ktlintTest)
testRuntimeOnly(externalLib.junitVintageEngine)
}
Any idea?Edoardo Luppi
02/19/2024, 1:41 PM/**
* Class to handle listing services on APIML gateway.
*/
external class Services {
Is there a way to force no empty lines?Kirill Zhukov
02/21/2024, 5:49 PMclass MyTests : StringSpec({
"length should return size of string" {
"hello".length shouldBe 5
}
})
Kotest (standard ruleset) formats it as following:
class MyTests : StringSpec(
{
"length should return size of string" {
"hello".length shouldBe 5
}
},
)
How do I prevent it from add a newline for the spec body lambda here? I see there was already this ticket for this from 4 years ago but curious if there's a solution here? What's the rule controlling this behavior?Emil Kantis
02/21/2024, 9:39 PMPaul Dingemans
02/28/2024, 7:28 PM1.2.0
is released. It contains 3 new rules:
• square-brackets-spacing
• kdoc
• blank-line-between-when-conditions
WARNING: The rules above have accidentally not been marked as experimental. A bugfix will be released later today!
See changelog for all details. The ktlint-intellij-plugin
will be released within one week from now. Artifacts can be downloaded from https://central.sonatype.com/search?q=com.pinterest.ktlint&sort=published.Carter
02/28/2024, 8:31 PMPablichjenkov
02/29/2024, 9:40 PMPaul Dingemans
02/29/2024, 10:04 PM1.2.1
is released. The new rules introduced in 1.2.0
are now marked as experimental. Also, some problems with the parsing of the CLI parameters have been resolved.
https://github.com/pinterest/ktlint/releases/tag/1.2.1Ubed
03/04/2024, 12:49 PMeygraber
03/08/2024, 9:53 PMigor.wojda
03/10/2024, 4:01 PMinternal class KoTypeDeclarationCore private constructor(
override val ktTypeReference: KtTypeReference,
override val containingDeclaration: KoBaseDeclaration,
) :
KoTypeDeclaration,
KoBaseProviderCore, //extra indent
KoNameProviderCore, //extra indent
Is this intentional?
What is the name of the ktlint rule?Seokjae Lee
03/14/2024, 1:30 AM_
) in function name?
For example, There's a query method feature in Spring Data project and for using this feature, I use underscore in function name.
fun findByUserDetail_UserId (userId)
But the ktlint said(Actually I use ktlint-gradle) the message below...
Function name should start with a lowercase letter (except factory methods) and use camel case (cannot be auto-corrected)
How can I allow it? 🤔Ryan Sang
03/20/2024, 7:31 PMprivate fun getList(): List<Int> {
return listOf(
1,
2, 3,
)
}
with ktlint_standard_parameter-list-wrapping = disabled
? I thought with this disabled that their could be multiple on one line. Full editorconfig in thread.Ryan Sang
03/21/2024, 8:42 PMlongBoolean
&& otherLongBoolean
&& anotherLongBoolean
versus
longBoolean &&
otherLongBoolean &&
anotherLongBoolean
I see condition-wrapping
, binary-expression-wrapping
mixed-condition-operators
in experimental but none hit my exact desire. (My preference comes from processing the logical inference at the start of the line, plus smaller diffs similar to trailing commas.)Paul Dingemans
03/21/2024, 8:43 PMjw
03/21/2024, 10:48 PMfoo
+ bar
Has two meanings depending on whether a unaryPlus is in scope via imports or supertypes.jw
03/21/2024, 10:49 PMwakingrufus
03/26/2024, 1:39 PMJaehwa Noh
04/02/2024, 11:31 PMktlint(ktlintVersion).editorConfigOverride(
mapOf(
"android" to "true",
),
)
I also asked this at Spotless, but they says It is relative with Ktlint so that I am here.Josh Feinberg
04/06/2024, 2:21 PMclass ModifierComposedCheck :
KtlintRule(
id = "compose:modifier-composed-check",
editorConfigProperties = setOf(customModifiers),
),
I have attempted to use
additionalEditorconfig.set(
mapOf(
"compose:modifier-composed-check" to "disabled"
)
)
or putting compose_modifier-composed-check = disabled
into my .editorConfig
and neither seems to be working. is there a proper way to disable custom rules like this?Paul Dingemans
04/06/2024, 3:57 PMJosh Feinberg
04/06/2024, 6:00 PMktlint_compose_modifier-composed-check = disabled
and ktlint_modifier-composed-check = disabled
both don't work for me, with either .editorConfig
or in the gradle configPaul Dingemans
04/06/2024, 6:20 PM.editorconfig
works with for example with
ktlint_compose_naming-check = disabled
What version of ktlint are you using? And, please make sure to explicitly save .editorconfig
before rerunning ktlint. For some reason the autosave of .editorconfig
in Intellij IDEA is not realiable.Josh Feinberg
04/06/2024, 6:47 PMLex Luthor
04/18/2024, 3:40 AM@Suppress("ktlint:standard:property-naming")
interface ExternalModel {
val sys_id: String?
val table_name: String
}
$ ./gradlew ktlintFormat
...
* What went wrong:
Execution failed for task ':runKtlintCheckOverMainSourceSet'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
> 'void org.jetbrains.kotlin.psi.psiUtil.PsiUtilsKt.checkDecompiledText(org.jetbrains.kotlin.com.intellij.psi.PsiElement)'
I am using the following configuration:
Gradle 8.6
Amazon Corretto 17.0.10-amzn
Ktlint Gradle 12.1.0
ktlint 1.2.1
Anyone come across this?Kev
04/18/2024, 6:12 AMKev
04/19/2024, 3:26 AMval foo = a { }.b { }.c { }.d { }
into
val foo = a {
}.b {
}.c {
}.d {
}
Pablichjenkov
04/19/2024, 11:26 AM