Skip to content

Commit

Permalink
feature/inline-classes(#698)
Browse files Browse the repository at this point in the history
### What's done:
  * Fixed bugs
  • Loading branch information
aktsay6 committed Jan 21, 2021
1 parent edc0fa9 commit 00e135b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class InlineClassesRule(private val configRule: List<RulesConfig>) : Rule("inlin
return false
}

private fun isExtendingClass(node: ASTNode): Boolean {
return node.getFirstChildWithType(SUPER_TYPE_LIST)?.children()?.any { it.hasChildOfType(CONSTRUCTOR_CALLEE) } ?: false
}
private fun isExtendingClass(node: ASTNode): Boolean =
node.getFirstChildWithType(SUPER_TYPE_LIST)?.children()?.any { it.hasChildOfType(CONSTRUCTOR_CALLEE) } ?: false


companion object {
val goodModifiers = listOf(PUBLIC_KEYWORD, PRIVATE_KEYWORD, FINAL_KEYWORD, PROTECTED_KEYWORD, INTERNAL_KEYWORD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import kotlinx.serialization.encodeToString
* Special test that checks that developer has not forgotten to add his warning to a diktat-analysis.yml
* This file is needed to be in tact with latest changes in Warnings.kt
*/
@Suppress("INLINE_CLASS_CAN_BE_USED")
class RulesConfigYamlTest {
private val pathMap = mapOf("diktat-analysis.yml" to "diKTat/diktat-rules/src/main/resources/diktat-analysis.yml",
"diktat-analysis-huawei.yml" to "diKTat/diktat-rules/src/main/resources/diktat-analysis-huawei.yml",
Expand Down

0 comments on commit 00e135b

Please sign in to comment.