Sha256: ec789baa4754436ad119c84ad94965ed7138963ee349a50fa4a77b5d12fcef64
Contents?: true
Size: 644 Bytes
Versions: 2
Compression:
Stored size: 644 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Style # This cop checks for unwanted parentheses in parameterless method calls. class MethodCallParentheses < Cop MSG = 'Do not use parentheses for method calls with no arguments.' def on_send(node) _receiver, _method_name, *args = *node convention(node, :begin) if args.empty? && node.loc.begin end def autocorrect_action(node) @corrections << lambda do |corrector| corrector.remove(node.loc.begin) corrector.remove(node.loc.end) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.13.1 | lib/rubocop/cop/style/method_call_parentheses.rb |
rubocop-0.13.0 | lib/rubocop/cop/style/method_call_parentheses.rb |