Sha256: b7062b69479b09338f1cfdbcf2ebf7cbb349b7dc48fa0f4e240e0b3221fb2bb8
Contents?: true
Size: 720 Bytes
Versions: 6852
Compression:
Stored size: 720 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Layout # Checks for comma (,) not followed by some kind of space. # # @example # # # bad # [1,2] # { foo:bar,} # # # good # [1, 2] # { foo:bar, } class SpaceAfterComma < Cop include SpaceAfterPunctuation def autocorrect(comma) PunctuationCorrector.add_space(comma) end def space_style_before_rcurly cfg = config.for_cop('Layout/SpaceInsideHashLiteralBraces') cfg['EnforcedStyle'] || 'space' end def kind(token) 'comma' if token.comma? end end end end end
Version data entries
6,852 entries across 6,827 versions & 29 rubygems