Skip to content

Commit

Permalink
Merge branch 'master' into feature/rule-6.1.7-implicit-backing-property(
Browse files Browse the repository at this point in the history
  • Loading branch information
aktsay6 authored Nov 23, 2020
2 parents 39e2c5c + cd83754 commit 4f0debd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,24 @@ class LocalVariablesWarnTest : LintTestBase(::LocalVariablesRule) {
""".trimMargin()
)
}

@Test
@Tag(WarningNames.LOCAL_VARIABLE_EARLY_DECLARATION)
fun `should not trigger on triple quoted strings`() {
lintMethod(
"""
|class Example {
| fun some() {
| val code = ${"\"\"\""}
| class Some {
| fun for() : String {
| }
| }
| ${"\"\"\""}.trimIndent()
| bar(code)
| }
|}
""".trimMargin()
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ class SpecialTagsInKdoc {
fun test() = Unit
}

fun `method name incorrect, part 4`() {
val code = """
class TestPackageName {
fun methODTREE(): String {
}
}
""".trimIndent()
lintMethod(code, LintError(2, 7, ruleId, "${FUNCTION_NAME_INCORRECT_CASE.warnText()} methODTREE", true))
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ class SpecialTagsInKdoc {
fun test() = Unit
}

fun `method name incorrect, part 4`() {
val code = """
class TestPackageName {
fun methODTREE(): String {
}
}
""".trimIndent()
lintMethod(code, LintError(2, 7, ruleId, "${FUNCTION_NAME_INCORRECT_CASE.warnText()} methODTREE", true))
}

0 comments on commit 4f0debd

Please sign in to comment.