Ruby

Ruby

Made by DeepSource

Improper position of comments RB-ST1024

Style
Minor

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.

Bad practice

if condition
  statement
end # end if

class X # comment
  statement
end

def x; end # comment

Recommended

if condition
  statement
end

class X # :nodoc:
  y
end