Sha256: 781a6eb4a16993319ad04349ebf02e89ab3c9a39aa3c857d2e4a1756b13506c4

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

require 'rubocop'

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

        def_node_matcher :sap?, <<-END
          (send nil
            {:sap}
            ...)
        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.0 lib/rubocop/cop/super_awesome_print/avoid.rb