diff --git a/diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter3/files/IndentationRule.kt b/diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter3/files/IndentationRule.kt index 0f244675ad..5059c59dfb 100644 --- a/diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter3/files/IndentationRule.kt +++ b/diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter3/files/IndentationRule.kt @@ -226,8 +226,8 @@ class IndentationRule(configRules: List) : DiktatRule( addException(exceptionInitiatorNode, expectedIndent - indentError.expected, checkResult.includeLastChild) } - if (astNode.treeParent.elementType == LONG_STRING_TEMPLATE_ENTRY && indentError.expected != indentError.actual) { - addException(astNode.treeParent, abs(indentError.expected - indentError.actual), false) + if (astNode.treeParent.elementType == LONG_STRING_TEMPLATE_ENTRY && astNode.treeNext.elementType != LONG_TEMPLATE_ENTRY_END) { + addException(astNode.treeParent, SINGLE.level() * configuration.indentationSize, false) } val alignedOpeningAndClosingQuotes = hasAlignedOpeningAndClosingQuotes(astNode, indentError.actual) diff --git a/diktat-rules/src/test/kotlin/com/saveourtool/diktat/ruleset/chapter3/spaces/IndentationRuleFixTest.kt b/diktat-rules/src/test/kotlin/com/saveourtool/diktat/ruleset/chapter3/spaces/IndentationRuleFixTest.kt index 09e52578cc..eae8025ea7 100644 --- a/diktat-rules/src/test/kotlin/com/saveourtool/diktat/ruleset/chapter3/spaces/IndentationRuleFixTest.kt +++ b/diktat-rules/src/test/kotlin/com/saveourtool/diktat/ruleset/chapter3/spaces/IndentationRuleFixTest.kt @@ -18,7 +18,6 @@ import com.saveourtool.diktat.util.FixTestBase import generated.WarningNames import org.assertj.core.api.Assertions.assertThat import org.intellij.lang.annotations.Language -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Tag import org.junit.jupiter.api.Test @@ -57,7 +56,6 @@ class IndentationRuleFixTest : FixTestBase("test/paragraph3/indentation", fixAndCompare("IndentationParametersExpected.kt", "IndentationParametersTest.kt") } - @Disabled("https://github.com/saveourtool/diktat/issues/1737") @Test @Tag(WarningNames.WRONG_INDENTATION) fun `indentation rule - example 1`() {