-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified 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 ### Issue (#1243)
- Loading branch information
Arrgentum
committed
May 24, 2022
1 parent
5e52117
commit 949f78a
Showing
12 changed files
with
192 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
diktat-rules/src/test/resources/test/paragraph3/long_line/LongDotQualifiedExpressionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package test.paragraph3.long_line | ||
|
||
val A = This.Is.Veeeeryyyyyyy.Loooooong.Dot.Qualified.Expression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
diktat-rules/src/test/resources/test/paragraph3/long_line/LongExpressionNoFixExpected2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.cqfn.diktat.resources.paragraph3.longline | ||
|
||
class veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong { | ||
// looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongggggggggggggggggggggggggg | ||
//looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongggggggggggggggggggggggggg | ||
val s = | ||
"d s d d d d ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
diktat-rules/src/test/resources/test/paragraph3/long_line/LongValueArgumentsListExpected.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package test.paragraph3.long_line | ||
|
||
val firstArgument = 1 | ||
val secondArgument = 2 | ||
val thirdArgument = 3 | ||
val fourthArgument = 4 | ||
val fifthArguments = 5 | ||
val sixthArguments = 6 | ||
val seventhArguments = 7 | ||
val eighthArguments = 8 | ||
|
||
// Many arguments in function | ||
val result1 = ManyParamInFunction(firstArgument, | ||
secondArgument, thirdArgument, fourthArgument, | ||
fifthArguments, sixthArguments, seventhArguments, | ||
eighthArguments) | ||
|
||
// | ||
val result2 = veryLongNameFun(firstArgument, | ||
secondArgument) | ||
|
||
// first argument cannot to be able to stay in | ||
// the first line | ||
val result3 = veryLongNameInFirstParam( | ||
firstArgument, secondArgument, thirdArgument | ||
) | ||
|
||
// first argument cannot to be able to stay in | ||
// the first line | ||
val result4 = veryLongNameInFirstParam( | ||
firstArgument | ||
) |
22 changes: 22 additions & 0 deletions
22
diktat-rules/src/test/resources/test/paragraph3/long_line/LongValueArgumentsListTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package test.paragraph3.long_line | ||
|
||
val firstArgument = 1 | ||
val secondArgument = 2 | ||
val thirdArgument = 3 | ||
val fourthArgument = 4 | ||
val fifthArguments = 5 | ||
val sixthArguments = 6 | ||
val seventhArguments = 7 | ||
val eighthArguments = 8 | ||
|
||
// Many arguments in function | ||
val result1 = ManyParamInFunction(firstArgument, secondArgument, thirdArgument, fourthArgument, fifthArguments, sixthArguments, seventhArguments, eighthArguments) | ||
|
||
// | ||
val result2 = veryLongNameFun(firstArgument, secondArgument) | ||
|
||
// first argument cannot to be able to stay in the first line | ||
val result3 = veryLongNameInFirstParam(firstArgument, secondArgument, thirdArgument) | ||
|
||
// first argument cannot to be able to stay in the first line | ||
val result4 = veryLongNameInFirstParam(firstArgument) |
3 changes: 3 additions & 0 deletions
3
diktat-rules/src/test/resources/test/smoke/src/main/kotlin/CheckLongLineExpected.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.cqfn.diktat | ||
|
||
val A = This.Is.Veeeeryyyyyyy.Loooooong.Dot.Qualified.Expression |
6 changes: 6 additions & 0 deletions
6
diktat-rules/src/test/resources/test/smoke/src/main/kotlin/CheckLongLineTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.cqfn.diktat | ||
|
||
/** | ||
* @return | ||
*/ | ||
val A = This.Is.Veeeeryyyyyyy.Loooooong.Dot.Qualified.Expression |