From a06a4e3a10b0fcdee7f114b46524b6f6cc3677fa Mon Sep 17 00:00:00 2001 From: Arrgentum Date: Tue, 31 May 2022 14:49:59 +0300 Subject: [PATCH] ### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * corrected code and KDoc in method appendNewlineMergingWhiteSpace in AstNodeUtils.kt * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243) --- .../org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt | 1 + .../long_line/LongDotQualifiedExpressionExpected.kt | 5 ++++- .../paragraph3/long_line/LongDotQualifiedExpressionTest.kt | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt index 3701ec9e78..344beed022 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt @@ -93,6 +93,7 @@ class LineLength(configRules: List) : DiktatRule( checkLength(it, configuration) } } + println(node.text) } } diff --git a/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionExpected.kt b/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionExpected.kt index 3bd4b53efd..040fc6fba7 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionExpected.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionExpected.kt @@ -1,5 +1,8 @@ package test.paragraph3.long_line +val G = +ThisIsVeryyyyLooooonDooootQualifiedExpressioWithoutDot.lalalala.lalalal + val A = This.Is.Veeeeryyyyyyy.Loooooong.Dot .Qualified.Expression @@ -19,4 +22,4 @@ val F = This!!.Is!!.Veeeeryyyyyyy!!.Loooooong!! .Dot!!.Qualified!!.Expression val G = -ThisIsVeryLonDotQualifiedExpressioWithoutDot.lalalala.lalalal \ No newline at end of file +ThisIsVeryyyyLooooonDooootQualifiedExpressioWithoutDot.lalalala.lalalal \ No newline at end of file diff --git a/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionTest.kt b/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionTest.kt index f8d5a8718e..507a42ea8e 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionTest.kt @@ -1,5 +1,7 @@ package test.paragraph3.long_line +val G = ThisIsVeryyyyLooooonDooootQualifiedExpressioWithoutDot.lalalala.lalalal + val A = This.Is.Veeeeryyyyyyy.Loooooong.Dot.Qualified.Expression val B = This?.Is?.Veeeeryyyyyyy?.Loooooong?.Dot?.Qualified?.Expression @@ -15,4 +17,4 @@ val E = This?.Is?.Veeeeryyyyyyy?.Loooooong?.Dot val F = This!!.Is!!.Veeeeryyyyyyy!!.Loooooong!! .Dot!!.Qualified!!.Expression -val G = ThisIsVeryLonDotQualifiedExpressioWithoutDot.lalalala.lalalal \ No newline at end of file +val G = ThisIsVeryyyyLooooonDooootQualifiedExpressioWithoutDot.lalalala.lalalal \ No newline at end of file