Skip to content

Commit

Permalink
Revert "Fixing issue with CommentSpacingRule which would insert a spa…
Browse files Browse the repository at this point in the history
…ce into a comment that was all forward slashes, e.g."

This reverts commit fd0a73a
  • Loading branch information
Stanley Shyiko committed Feb 4, 2019
1 parent 501fa09 commit 7448e8b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil

class CommentSpacingRule : Rule("comment-spacing") {

private val allForwardSlashesRegex = Regex("\\/+")

override fun visit(
node: ASTNode,
autoCorrect: Boolean,
Expand All @@ -31,8 +29,7 @@ class CommentSpacingRule : Rule("comment-spacing") {
!text.startsWith("//noinspection") &&
!text.startsWith("//region") &&
!text.startsWith("//endregion") &&
!text.startsWith("//language=") &&
!allForwardSlashesRegex.matches(text)
!text.startsWith("//language=")
) {
emit(node.startOffset, "Missing space after //", true)
if (autoCorrect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,4 @@ class CommentSpacingRuleTest {
""".trimIndent()
)
}

@Test
fun testAllForwardSlashes() {
assertThat(CommentSpacingRule().lint(
"""
//////////////////////
// function
//////////////////////
""".trimIndent()
)).isEmpty()
}
}

0 comments on commit 7448e8b

Please # to comment.