-
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.
Added logic for parameters and supertypes lists to NewlinesRule (#431)
### What's done: * Changed logic * Added tests * Updated code style guide
- Loading branch information
Showing
10 changed files
with
239 additions
and
22 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
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
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
26 changes: 26 additions & 0 deletions
26
diktat-rules/src/test/resources/test/paragraph3/newlines/ParameterListExpected.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,26 @@ | ||
package test.paragraph3.newlines | ||
|
||
fun bar( | ||
arg1: Int, | ||
arg2: Int, | ||
arg3: Int) { } | ||
|
||
class Foo : FooBase<Bar>(), | ||
BazInterface, | ||
BazSuperclass { } | ||
|
||
class Foo(val arg1: Int, arg2: Int) { } | ||
|
||
class Foo( | ||
val arg1: Int, | ||
arg2: Int, | ||
arg3: Int) { | ||
constructor( | ||
arg1: Int, | ||
arg2: String, | ||
arg3: String) : this(arg1, 0, 0) { } | ||
} | ||
|
||
class Foo(val arg1: Int, | ||
var arg2: Int, | ||
arg3: Int) { } |
15 changes: 15 additions & 0 deletions
15
diktat-rules/src/test/resources/test/paragraph3/newlines/ParameterListTest.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,15 @@ | ||
package test.paragraph3.newlines | ||
|
||
fun bar(arg1: Int, arg2: Int, arg3: Int) { } | ||
|
||
class Foo : FooBase<Bar>(), BazInterface, BazSuperclass { } | ||
|
||
class Foo(val arg1: Int, arg2: Int) { } | ||
|
||
class Foo(val arg1: Int, arg2: Int, arg3: Int) { | ||
constructor(arg1: Int, arg2: String, arg3: String) : this(arg1, 0, 0) { } | ||
} | ||
|
||
class Foo(val arg1: Int, | ||
var arg2: Int, | ||
arg3: Int) { } |
Oops, something went wrong.
e273989
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to GitHub. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: