class RuboCop::Cop::Layout::SpaceAfterComma

{ foo:bar, }
[1, 2]
# good
{ foo:bar,}
# bad
@example
Checks for comma (‘,`) not followed by some kind of space.

def before_semicolon?(token)

def before_semicolon?(token)
  tokens = processed_source.tokens
  tokens[tokens.index(token) + 1].semicolon?
end

def kind(token)

def kind(token)
  'comma' if token.comma? && !before_semicolon?(token)
end

def space_style_before_rcurly

def space_style_before_rcurly
  cfg = config.for_cop('Layout/SpaceInsideHashLiteralBraces')
  cfg['EnforcedStyle'] || 'space'
end