Skip to content

Files

Latest commit

 

History

History
40 lines (28 loc) · 603 Bytes

Style-CommentedKeyword.md

File metadata and controls

40 lines (28 loc) · 603 Bytes

Pattern: Commented keyword

Issue: -

Description

This rule checks for comments put on the same line as some keywords. These keywords are: begin, class, def, end, module.

Note that some comments such as :nodoc: and rubocop:disable are allowed.

Examples

# bad
if condition
  statement
end # end if

# bad
class X # comment
  statement
end

# bad
def x; end # comment

# good
if condition
  statement
end

# good
class X # :nodoc:
  y
end

Further Reading