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 24
def kind(token)
  'comma' if token.type == :tCOMMA
end
space_style_before_rcurly() click to toggle source
# File lib/rubocop/cop/layout/space_after_comma.rb, line 19
def space_style_before_rcurly
  cfg = config.for_cop('Layout/SpaceInsideHashLiteralBraces')
  cfg['EnforcedStyle'] || 'space'
end