Sha256: dd86a025752d95768ac017e625316c55885bf08fcb861bdf89770fde2a796640

Contents?: true

Size: 658 Bytes

Versions: 128

Compression:

Stored size: 658 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 < Base
        include SpaceAfterPunctuation
        extend AutoCorrector

        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

128 entries across 120 versions & 13 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/space_after_comma.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/space_after_comma.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.26.0/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.31.2/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-1.52.1/lib/rubocop/cop/layout/space_after_comma.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.52.1/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-1.54.0 lib/rubocop/cop/layout/space_after_comma.rb
rubocop-1.53.1 lib/rubocop/cop/layout/space_after_comma.rb
rubocop-1.53.0 lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.26.0/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.52.1/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/space_after_comma.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-1.31.2/lib/rubocop/cop/layout/space_after_comma.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-1.52.1/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-1.52.1 lib/rubocop/cop/layout/space_after_comma.rb
rubocop-1.52.0 lib/rubocop/cop/layout/space_after_comma.rb