Skip to content

Commit

Permalink
bugfix/local-variable-loops(#581)
Browse files Browse the repository at this point in the history
### What's done:
  * Fixed bugs
  • Loading branch information
aktsay6 committed Dec 14, 2020
1 parent 0a6f969 commit 670d7b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class LineLength(private val configRules: List<RulesConfig>) : Rule("line-length
return text
}

@Suppress("UnsafeCallOnNullableType")
@Suppress("UnsafeCallOnNullableType", "LOCAL_VARIABLE_EARLY_DECLARATION")
private fun getBraceAndBeforeText(node: ASTNode, prevNode: ASTNode): String {
var text = ""
val par = prevNode.prevSibling { it.elementType == OPERATION_REFERENCE }?.let { LPAR } ?: RPAR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class LocalVariablesWarnTest : LintTestBase(::LocalVariablesRule) {
@Tag(WarningNames.LOCAL_VARIABLE_EARLY_DECLARATION)
fun `should not trigger on space after last val`() {
lintMethod(
"""
"""
| private fun collectAllExtensionFunctions(node: ASTNode): SimilarSignatures {
| val extensionFunctionList = node.findAllNodesWithSpecificType(FUN).filter { it.hasChildOfType(TYPE_REFERENCE) && it.hasChildOfType(DOT) }
| val distinctFunctionSignatures = mutableMapOf<FunctionSignature, ASTNode>() // maps function signatures on node it is used by
Expand Down

0 comments on commit 670d7b6

Please sign in to comment.