class RuboCop::Cop::StatsD::MetricPrefixArgument
This Rubocop will check for specifying the `prefix` keyword argument on `StatsD` metric methods and `statsd_*` metaprogramming methods. To run this cop on your codebase:
rubocop --require `bundle show statsd-instrument`/lib/statsd/instrument/rubocop.rb \ --only StatsD/MetricPrefixArgument
This cop will not autocorrect offenses.
Constants
- MSG
Public Instance Methods
on_send(node)
click to toggle source
# File lib/statsd/instrument/rubocop/metric_prefix_argument.rb, line 25 def on_send(node) if metric_method?(node) add_offense(node) if has_keyword_argument?(node, :prefix) end if metaprogramming_method?(node) add_offense(node) if has_keyword_argument?(node, :prefix) end end