class RuboCop::Cop::Layout::LeadingCommentSpace

Checks whether comments have a leading space after the ‘#` denoting the start of the comment. The leading space is not required for some RDoc special syntax, like `#++`, `#–`, `#:nodoc`, `=begin`- and `=end` comments, “shebang” directives, or rackup options.

@example

# bad
#Some comment

# good
# Some comment

@example AllowDoxygenCommentStyle: false (default)

# bad

#**
# Some comment
# Another line of comment
#*

@example AllowDoxygenCommentStyle: true

# good

#**
# Some comment
# Another line of comment
#*

@example AllowGemfileRubyComment: false (default)

# bad

#ruby=2.7.0
#ruby-gemset=myproject

@example AllowGemfileRubyComment: true

# good

#ruby=2.7.0
#ruby-gemset=myproject

@example AllowRBSInlineAnnotation: false (default)

# bad

include Enumerable #[Integer]

attr_reader :name #: String
attr_reader :age  #: Integer?

#: (
#|   Integer,
#|   String
#| ) -> void
def foo; end

@example AllowRBSInlineAnnotation: true

# good

include Enumerable #[Integer]

attr_reader :name #: String
attr_reader :age  #: Integer?

#: (
#|   Integer,
#|   String
#| ) -> void
def foo; end

@example AllowSteepAnnotation: false (default)

# bad
[1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer]
  list << n
end

name = 'John'      #: String

@example AllowSteepAnnotation: true

# good

[1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer]
  list << n
end

name = 'John'      #: String