Sha256: a6c63cc4a6c95110f55fa950ae7143bd4c8f2fc3d7d802a81b81f017b4af04da

Contents?: true

Size: 481 Bytes

Versions: 1

Compression:

Stored size: 481 Bytes

Contents

require 'rubocop'

module RuboCop
  module Cop
    module SuperAwesomePrint
      class Avoid < Cop # rubocop:disable Style/Documentation
        MSG = 'Avoid `sap` and `sapf` in production'.freeze

        def_node_matcher :sap?, <<-END
          (send nil
            {:sap :sapf}
            ...)
        END

        def on_send(node)
          return unless sap?(node)
          add_offense(node, :expression, format(MSG, node.source))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
super_awesome_print_rubocop-0.1.1 lib/rubocop/cop/super_awesome_print/avoid.rb