Skip to content

Commit

Permalink
More changes with renaming + stabilization of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orchestr7 committed Jun 7, 2023
1 parent 9f966e7 commit a20f6b2
Show file tree
Hide file tree
Showing 32 changed files with 544 additions and 0 deletions.
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 {
}
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 {
}
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 {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import com.saveourtool.diktat.ktlint.core.Rule

class TestPackageName {
}
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 {
}
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 {
}
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 {
}
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 {
}
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 {
}
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 {
}
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 {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@file:Suppress("CONSTANT_UPPERCASE")
val a = 5

class TestPackageName {
}
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 {
}
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 {
}
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
}
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
}
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
}
}
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
}
}
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
}
}
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()
}
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()
}
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
}
}
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
}
}
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
}
}
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
}
}
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
}
}
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
}
Loading

0 comments on commit a20f6b2

Please sign in to comment.