-
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.
More changes with renaming + stabilization of tests
- Loading branch information
Showing
32 changed files
with
544 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...1/naming/package/src/main/kotlin/com/saveourtool/diktat/some/name/FixIncorrectExpected.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 /* AAAAAA */ com.saveourtool.diktat.some.name | ||
|
||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
6 changes: 6 additions & 0 deletions
6
...raph1/naming/package/src/main/kotlin/com/saveourtool/diktat/some/name/FixIncorrectTest.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 /* AAAAAA */ some.buggy.way.to | ||
|
||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
5 changes: 5 additions & 0 deletions
5
...ph1/naming/package/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingExpected.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,5 @@ | ||
package com.saveourtool.diktat.some.name | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
4 changes: 4 additions & 0 deletions
4
...agraph1/naming/package/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingTest.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,4 @@ | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
7 changes: 7 additions & 0 deletions
7
...kage/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithAnnotationExpected.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,7 @@ | ||
@file:Suppress("CONSTANT_UPPERCASE") | ||
|
||
package com.saveourtool.diktat.some.name | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
6 changes: 6 additions & 0 deletions
6
...age/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithAnnotationExpected2.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 @@ | ||
@file:Suppress("CONSTANT_UPPERCASE") // comment | ||
package com.saveourtool.diktat.some.name | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
9 changes: 9 additions & 0 deletions
9
...age/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithAnnotationExpected3.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,9 @@ | ||
/** | ||
* comment | ||
*/ | ||
@file:Suppress("CONSTANT_UPPERCASE") | ||
package com.saveourtool.diktat.some.name | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
6 changes: 6 additions & 0 deletions
6
.../package/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithAnnotationTest.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 @@ | ||
@file:Suppress("CONSTANT_UPPERCASE") | ||
|
||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
5 changes: 5 additions & 0 deletions
5
...package/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithAnnotationTest2.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,5 @@ | ||
@file:Suppress("CONSTANT_UPPERCASE") // comment | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
8 changes: 8 additions & 0 deletions
8
...package/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithAnnotationTest3.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 @@ | ||
/** | ||
* comment | ||
*/ | ||
@file:Suppress("CONSTANT_UPPERCASE") | ||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
7 changes: 7 additions & 0 deletions
7
...ckage/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithoutImportExpected.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,7 @@ | ||
@file:Suppress("CONSTANT_UPPERCASE") | ||
package com.saveourtool.diktat.some.name | ||
|
||
val a = 5 | ||
|
||
class TestPackageName { | ||
} |
5 changes: 5 additions & 0 deletions
5
...g/package/src/main/kotlin/com/saveourtool/diktat/some/name/FixMissingWithoutImportTest.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,5 @@ | ||
@file:Suppress("CONSTANT_UPPERCASE") | ||
val a = 5 | ||
|
||
class TestPackageName { | ||
} |
6 changes: 6 additions & 0 deletions
6
.../package/src/main/kotlin/com/saveourtool/diktat/some/name/FixPackageRegressionExpected.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 com.saveourtool.diktat.some.name | ||
|
||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
6 changes: 6 additions & 0 deletions
6
...ming/package/src/main/kotlin/com/saveourtool/diktat/some/name/FixPackageRegressionTest.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 app | ||
|
||
import com.saveourtool.diktat.ktlint.core.Rule | ||
|
||
class TestPackageName { | ||
} |
7 changes: 7 additions & 0 deletions
7
...ph2/kdoc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/EmptyKdocExpected.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,7 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
val foo = 42 | ||
|
||
fun doNothing() { | ||
return | ||
} |
7 changes: 7 additions & 0 deletions
7
...raph2/kdoc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/EmptyKdocTested.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,7 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
val foo = 42 | ||
|
||
fun doNothing() { | ||
return | ||
} |
36 changes: 36 additions & 0 deletions
36
...oc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/KdocMethodsFullExpected.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,36 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
class KdocMethodsFull { | ||
fun test1() { | ||
// this function does nothing | ||
} | ||
|
||
/** | ||
* This function is described | ||
* partially. | ||
* @param a | ||
* @return | ||
*/ | ||
fun test2(a: Int): Int { | ||
return 2 * a | ||
} | ||
|
||
companion object { | ||
/** | ||
* @param a | ||
* @throws IllegalStateException | ||
*/ | ||
fun test3(a: Int) { | ||
throw IllegalStateException("Lorem ipsum") | ||
} | ||
} | ||
|
||
private class Nested { | ||
/** | ||
* @param a | ||
* @param b | ||
* @return | ||
*/ | ||
fun test4(a: Int, b: Int): Int = 42 | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...kdoc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/KdocMethodsFullTested.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,25 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
class KdocMethodsFull { | ||
fun test1() { | ||
// this function does nothing | ||
} | ||
|
||
/** | ||
* This function is described | ||
* partially. | ||
*/ | ||
fun test2(a: Int): Int { | ||
return 2 * a | ||
} | ||
|
||
companion object { | ||
fun test3(a: Int) { | ||
throw IllegalStateException("Lorem ipsum") | ||
} | ||
} | ||
|
||
private class Nested { | ||
fun test4(a: Int, b: Int): Int = 42 | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...2/kdoc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/MissingKdocExpected.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,14 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
class Example { | ||
/** | ||
* @param a | ||
* @param b | ||
* @return | ||
* @throws IllegalStateException | ||
*/ | ||
fun addInts(a: Int, b: Int): Int { | ||
if (false) throw IllegalStateException() | ||
return a + b | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...kage/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/MissingKdocOnFunctionExpected.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,16 @@ | ||
package test.paragraph2.kdoc | ||
|
||
class Example { | ||
/** | ||
* @return | ||
*/ | ||
fun hasNoChildren() = children.size == 0 | ||
|
||
/** | ||
* @return | ||
*/ | ||
fun getFirstChild() = children.elementAtOrNull(0) | ||
|
||
@GetMapping("/projects") | ||
fun getProjects() = projectService.getProjects() | ||
} |
10 changes: 10 additions & 0 deletions
10
.../package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/MissingKdocOnFunctionTest.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,10 @@ | ||
package test.paragraph2.kdoc | ||
|
||
class Example { | ||
fun hasNoChildren() = children.size == 0 | ||
|
||
fun getFirstChild() = children.elementAtOrNull(0) | ||
|
||
@GetMapping("/projects") | ||
fun getProjects() = projectService.getProjects() | ||
} |
8 changes: 8 additions & 0 deletions
8
...ph2/kdoc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/MissingKdocTested.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 com.saveourtool.diktat.kdoc.methods | ||
|
||
class Example { | ||
fun addInts(a: Int, b: Int): Int { | ||
if (false) throw IllegalStateException() | ||
return a + b | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...e/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/MissingKdocWithModifiersExpected.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.paragraph2.kdoc | ||
|
||
class Example { | ||
/** | ||
* @param a | ||
* @param b | ||
* @return | ||
* @throws IllegalStateException | ||
*/ | ||
@Deprecated("Use something else") | ||
internal fun addInts(a: Int, b: Int): Int { | ||
if (false) throw IllegalStateException() | ||
return a + b | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ckage/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/MissingKdocWithModifiersTest.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,9 @@ | ||
package test.paragraph2.kdoc | ||
|
||
class Example { | ||
@Deprecated("Use something else") | ||
internal fun addInts(a: Int, b: Int): Int { | ||
if (false) throw IllegalStateException() | ||
return a + b | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
.../package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/ParamTagInsertionExpected.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,48 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
class Example { | ||
/** | ||
* Lorem ipsum | ||
* @param a | ||
*/ | ||
fun test1(a: Int): Unit { } | ||
|
||
/** | ||
* Lorem ipsum | ||
* @param a | ||
* @return integer value | ||
*/ | ||
fun test2(a: Int): Int = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @param a | ||
* @throws IllegalStateException | ||
*/ | ||
fun test3(a: Int) { | ||
throw IllegalStateException("dolor sit amet") | ||
} | ||
|
||
/** | ||
* Lorem ipsum | ||
* @param a | ||
* @return integer value | ||
* @throws IllegalStateException | ||
*/ | ||
fun test4(a: Int): Int { | ||
throw IllegalStateException("dolor sit amet") | ||
return 0 | ||
} | ||
|
||
/** | ||
* Lorem ipsum | ||
* @param a | ||
* @param b | ||
* @return integer value | ||
* @throws IllegalStateException | ||
*/ | ||
fun test5(a: Int, b: String): Int { | ||
throw IllegalStateException("dolor sit amet") | ||
return 0 | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...oc/package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/ParamTagInsertionTested.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,42 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
class Example { | ||
/** | ||
* Lorem ipsum | ||
*/ | ||
fun test1(a: Int): Unit { } | ||
|
||
/** | ||
* Lorem ipsum | ||
* @return integer value | ||
*/ | ||
fun test2(a: Int): Int = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @throws IllegalStateException | ||
*/ | ||
fun test3(a: Int) { | ||
throw IllegalStateException("dolor sit amet") | ||
} | ||
|
||
/** | ||
* Lorem ipsum | ||
* @return integer value | ||
* @throws IllegalStateException | ||
*/ | ||
fun test4(a: Int): Int { | ||
throw IllegalStateException("dolor sit amet") | ||
return 0 | ||
} | ||
|
||
/** | ||
* Lorem ipsum | ||
* @return integer value | ||
* @throws IllegalStateException | ||
*/ | ||
fun test5(a: Int, b: String): Int { | ||
throw IllegalStateException("dolor sit amet") | ||
return 0 | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...package/src/main/kotlin/com/saveourtool/diktat/kdoc/methods/ReturnTagInsertionExpected.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,43 @@ | ||
package com.saveourtool.diktat.kdoc.methods | ||
|
||
class Example { | ||
/** | ||
* Lorem ipsum | ||
* @return | ||
*/ | ||
fun test1(): Int = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @param a integer parameter | ||
* @return | ||
*/ | ||
fun test2(a: Int): Int = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @return | ||
* @throws IllegalStateException never | ||
*/ | ||
fun test3(): Int = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @param a integer parameter | ||
* @return | ||
* @throws IllegalStateException never | ||
*/ | ||
fun test4(a: Int): Int = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @throws IllegalStateException never | ||
*/ | ||
fun test5() = 0 | ||
|
||
/** | ||
* Lorem ipsum | ||
* @throws IllegalStateException never | ||
*/ | ||
fun A.test6() = 0 | ||
} |
Oops, something went wrong.