Skip to content

Commit

Permalink
Merge pull request #212 from vanniktech/CommentSpacingRule
Browse files Browse the repository at this point in the history
CommentSpacingRule: Exclude //noinspection.
  • Loading branch information
shyiko authored May 16, 2018
2 parents 323b8d6 + 1fa73a1 commit cb6b5cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CommentSpacingRule : Rule("comment-spacing") {
}
}
val text = node.getText()
if (text.length != 2 && !text.startsWith("// ")) {
if (text.length != 2 && !text.startsWith("// ") && !text.startsWith("//noinspection")) {
emit(node.startOffset, "Missing space after //", true)
if (autoCorrect) {
node.rawReplaceWithText("// " + text.removePrefix("//"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CommentSpacingRuleTest {
assertThat(CommentSpacingRule().lint(
"""
//
//noinspection AndroidLintRecycle
// comment
var debugging = false // comment
var debugging = false // comment//word
Expand Down

0 comments on commit cb6b5cb

Please sign in to comment.