Comments, when put on the same line as some keywords (begin
, class
, def
, end
, module
),
cause this issue.
Some comments, such as :nodoc
, :yields
, rubocop:disable
, rubocop:todo
, skipcq
and skipcq: RB-ST1024
are allowed.
if condition
statement
end # end if
class X # comment
statement
end
def x; end # comment
if condition
statement
end
class X # :nodoc:
y
end