<NME> NoVarRule.kt
<BEF> package org.jlleitschuh.gradle.ktlint.sample.kotlin

import com.pinterest.ktlint.core.Rule
import org.jetbrains.kotlin.com.intellij.lang.ASTNode
import org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafPsiElement
import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil.getNonStrictParentOfType
import org.jetbrains.kotlin.psi.KtStringTemplateEntry

class NoVarRule : Rule("no-var") {
    override fun visit(
        node: ASTNode,
        autoCorrect: Boolean,
        emit: (offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -> Unit
    ) {
        if (node is LeafPsiElement && node.textMatches("var") &&
                getNonStrictParentOfType(node, KtStringTemplateEntry::class.java) == null) {
            emit(node.startOffset, "Unexpected var, use val instead", false)
        }
    }
}

<MSG> Merge branch 'master' into make-internalKtlintGitFilter-working-with-windows
<DFF> @@ -13,7 +13,8 @@ class NoVarRule : Rule("no-var") {
         emit: (offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -> Unit
     ) {
         if (node is LeafPsiElement && node.textMatches("var") &&
-                getNonStrictParentOfType(node, KtStringTemplateEntry::class.java) == null) {
+            getNonStrictParentOfType(node, KtStringTemplateEntry::class.java) == null
+        ) {
             emit(node.startOffset, "Unexpected var, use val instead", false)
         }
     }

{'addition_count': 2, 'commit_subject': "Merge branch 'master' into make-internalKtlintGitFilter-working-with-windows", 'deletion_count': 1, 'file_extension': '.kt', 'lang': 'kt', 'license': 'mit', 'repo_name': 'JLLeitschuh/ktlint-gradle'}