From 0934f37d5a469c6fcc9287ebff92d0b6b971e75c Mon Sep 17 00:00:00 2001 From: Paul Dingemans Date: Wed, 27 Dec 2023 12:05:39 +0100 Subject: [PATCH] Loosen dependency between chain-method-continuation and argument-list-wrapping Allow the chain-method-continuation rule to be run when argument-list-wrapping is disabled or not loaded. Whenever both rules are loaded, the argument-list-wrapping takes precedence and runs before the chain-method-continuation. Closes #2452 --- .../ktlint/ruleset/standard/rules/ChainMethodContinuationRule.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRule.kt b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRule.kt index 5ddf6d1bdd..51f30c36aa 100644 --- a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRule.kt +++ b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRule.kt @@ -146,7 +146,6 @@ public class ChainMethodContinuationRule : chainOperator.shouldBeOnSameLineAsClosingElementOfPreviousExpressionInMethodChain() -> { removeWhiteSpaceBeforeChainOperator(chainOperator, emit, autoCorrect) } - wrapBeforeEachChainOperator || exceedsMaxLineLength || chainOperator.isPrecededByComment() -> { insertWhiteSpaceBeforeChainOperator(chainOperator, emit, autoCorrect) }