Sha256: b7062b69479b09338f1cfdbcf2ebf7cbb349b7dc48fa0f4e240e0b3221fb2bb8

Contents?: true

Size: 720 Bytes

Versions: 6896

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,896 entries across 6,871 versions & 30 rubygems

Version Path
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/rubocop-0.75.1/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-0.75.1 lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/rubocop-0.74.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/rubocop-0.75.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-0.75.0 lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/rubocop-0.74.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/rubocop-0.74.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/rubocop-0.74.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/rubocop-0.74.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-0.74.0 lib/rubocop/cop/layout/space_after_comma.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-0.73.0 lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/rubocop-0.72.0/lib/rubocop/cop/layout/space_after_comma.rb
rubocop-0.72.0 lib/rubocop/cop/layout/space_after_comma.rb