Skip to content

Commit

Permalink
feature/class-cast-exception-kdoc(#480)
Browse files Browse the repository at this point in the history
### What's done:
  * Fixed bugs
  • Loading branch information
aktsay6 committed Nov 20, 2020
1 parent 82e9279 commit 02941fe
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class KdocFormatting(private val configRules: List<RulesConfig>) : Rule("kdoc-fo
?.text
?.substringAfter('\n')
?.count { it == ' ' } ?: 0
node.addChild(LeafPsiElement(WHITE_SPACE, "\n${" ".repeat(indent)}"), null)
node.addChild(PsiWhiteSpaceImpl("\n${" ".repeat(indent)}"), null)
node.addChild(LeafPsiElement(KDOC_LEADING_ASTERISK, "*"), null)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ class DiktatSmokeTest : FixTestBase("test/smoke/src/main/kotlin",
fixAndCompare("Example3Expected.kt", "Example3Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `smoke test #4`() {
fixAndCompare("Example4Expected.kt", "Example4Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `regression - should not fail if package is not set`() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.cqfn.diktat

class SpecialTagsInKdoc {
/**
* Empty function to test KDocs
* @apiNote foo
*
* @implSpec bar
*
* @implNote baz
*
* @return
*/
fun test() = Unit
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.cqfn.diktat

class SpecialTagsInKdoc {

/**
* Empty function to test KDocs
* @apiNote foo
* @implSpec bar
*
*
* @implNote baz
*/
fun test() = Unit
}

0 comments on commit 02941fe

Please sign in to comment.