Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Differentiate between correctable and non-correctable KtLint rules
- Loading branch information
1 parent
93a2306
commit 3fbbfcb
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...g/src/test/kotlin/io/gitlab/arturbosch/detekt/formatting/RulesWhichCantBeCorrectedSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.gitlab.arturbosch.detekt.formatting | ||
|
||
import io.gitlab.arturbosch.detekt.api.CodeSmell | ||
import io.gitlab.arturbosch.detekt.api.Config | ||
import io.gitlab.arturbosch.detekt.formatting.wrappers.Filename | ||
import io.gitlab.arturbosch.detekt.formatting.wrappers.PackageName | ||
import io.gitlab.arturbosch.detekt.test.assertThat | ||
import org.junit.jupiter.api.Test | ||
|
||
class RulesWhichCantBeCorrectedSpec { | ||
|
||
@Test | ||
fun `verify findings of these rules are not correctable`() { | ||
val code = """ | ||
package under_score | ||
class NotTheFilename | ||
""".trimIndent() | ||
|
||
assertThat(Filename(Config.empty).lint(code)) | ||
.isNotEmpty | ||
.hasExactlyElementsOfTypes(CodeSmell::class.java) | ||
assertThat(PackageName(Config.empty).lint(code)) | ||
.isNotEmpty | ||
.hasExactlyElementsOfTypes(CodeSmell::class.java) | ||
} | ||
} |