Sha256: 0c7709e23be777485485821924b29b33f07f20c5c5459cfb49e1578d8975618e

Contents?: true

Size: 498 Bytes

Versions: 5

Compression:

Stored size: 498 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Style
      # This cop checks for uses if the keyword *not* instead of !.
      class Not < Cop
        MSG = 'Use ! instead of not.'

        def on_send(node)
          _receiver, method_name, *args = *node

          # not does not take any arguments
          if args.empty? && method_name == :! &&
              node.loc.selector.is?('not')
            convention(node, :selector)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.15.0 lib/rubocop/cop/style/not.rb
rubocop-0.14.1 lib/rubocop/cop/style/not.rb
rubocop-0.14.0 lib/rubocop/cop/style/not.rb
rubocop-0.13.1 lib/rubocop/cop/style/not.rb
rubocop-0.13.0 lib/rubocop/cop/style/not.rb