Skip to content

Commit 7448e8b

Browse files
author
Stanley Shyiko
committed
Revert "Fixing issue with CommentSpacingRule which would insert a space into a comment that was all forward slashes, e.g."
This reverts commit fd0a73a
1 parent 501fa09 commit 7448e8b

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

ktlint-ruleset-standard/src/main/kotlin/com/github/shyiko/ktlint/ruleset/standard/CommentSpacingRule.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil
1010

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

13-
private val allForwardSlashesRegex = Regex("\\/+")
14-
1513
override fun visit(
1614
node: ASTNode,
1715
autoCorrect: Boolean,
@@ -31,8 +29,7 @@ class CommentSpacingRule : Rule("comment-spacing") {
3129
!text.startsWith("//noinspection") &&
3230
!text.startsWith("//region") &&
3331
!text.startsWith("//endregion") &&
34-
!text.startsWith("//language=") &&
35-
!allForwardSlashesRegex.matches(text)
32+
!text.startsWith("//language=")
3633
) {
3734
emit(node.startOffset, "Missing space after //", true)
3835
if (autoCorrect) {

ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/CommentSpacingRuleTest.kt

-11
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,4 @@ class CommentSpacingRuleTest {
6565
""".trimIndent()
6666
)
6767
}
68-
69-
@Test
70-
fun testAllForwardSlashes() {
71-
assertThat(CommentSpacingRule().lint(
72-
"""
73-
//////////////////////
74-
// function
75-
//////////////////////
76-
""".trimIndent()
77-
)).isEmpty()
78-
}
7968
}

0 commit comments

Comments
 (0)