Skip to content

Commit

Permalink
bugfix/compact-incorrect-tree(#599)
Browse files Browse the repository at this point in the history
### What's done:
  * Fixed bugs
  • Loading branch information
aktsay6 committed Dec 8, 2020
1 parent d290442 commit 9d9f897
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("FILE_UNORDERED_IMPORTS")
package org.cqfn.diktat.ruleset.rules.classes

import com.pinterest.ktlint.core.Rule
import com.pinterest.ktlint.core.ast.ElementType.LBRACE
import com.pinterest.ktlint.core.ast.ElementType.WHITE_SPACE
import com.pinterest.ktlint.core.ast.isPartOfComment
Expand All @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.psiUtil.siblings
import org.jetbrains.kotlin.psi.psiUtil.startOffset

import com.pinterest.ktlint.core.Rule

/**
* This rules checks if an object initialization can be wrapped into an `apply` function.
Expand All @@ -34,9 +35,9 @@ class CompactInitialization(private val configRules: List<RulesConfig>) : Rule("
private lateinit var emitWarn: EmitType

override fun visit(
node: ASTNode,
autoCorrect: Boolean,
emit: EmitType
node: ASTNode,
autoCorrect: Boolean,
emit: EmitType
) {
emitWarn = emit
isFixMode = autoCorrect
Expand Down

0 comments on commit 9d9f897

Please sign in to comment.