class RuboCop::Cop::Layout::SpaceAfterComma

Checks for comma (,) not followed by some kind of space.

@example

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Public Instance Methods

kind(token) click to toggle source
# File lib/rubocop/cop/layout/space_after_comma.rb, line 26
def kind(token)
  'comma' if token.comma?
end
space_style_before_rcurly() click to toggle source
# File lib/rubocop/cop/layout/space_after_comma.rb, line 21
def space_style_before_rcurly
  cfg = config.for_cop('Layout/SpaceInsideHashLiteralBraces')
  cfg['EnforcedStyle'] || 'space'
end