Sha256: cb6e1c322594eeecfe9526c2ec842b0a1a93ba526a6c1b0ed1f0ef06c9c6b44b

Contents?: true

Size: 908 Bytes

Versions: 6775

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Naming
      # This cop makes sure that all methods use the configured style,
      # snake_case or camelCase, for their names.
      #
      # @example EnforcedStyle: snake_case (default)
      #   # bad
      #   def fooBar; end
      #
      #   # good
      #   def foo_bar; end
      #
      # @example EnforcedStyle: camelCase
      #   # bad
      #   def foo_bar; end
      #
      #   # good
      #   def fooBar; end
      class MethodName < Cop
        include ConfigurableNaming

        MSG = 'Use %<style>s for method names.'.freeze

        def on_def(node)
          return if node.operator_method?

          check_name(node, node.method_name, node.loc.name)
        end
        alias on_defs on_def

        private

        def message(style)
          format(MSG, style: style)
        end
      end
    end
  end
end

Version data entries

6,775 entries across 6,769 versions & 24 rubygems

Version Path
cybrid_api_organization_ruby-0.123.118 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_bank_ruby-0.123.117 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_id_ruby-0.123.117 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_organization_ruby-0.123.117 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_bank_ruby-0.123.116 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_organization_ruby-0.123.116 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_id_ruby-0.123.116 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_bank_ruby-0.123.115 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_id_ruby-0.123.115 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_organization_ruby-0.123.115 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
ory-client-1.15.17 vendor/bundle/ruby/3.1.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_bank_ruby-0.123.114 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_organization_ruby-0.123.114 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_id_ruby-0.123.114 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_organization_ruby-0.123.113 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_bank_ruby-0.123.113 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_id_ruby-0.123.113 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_organization_ruby-0.123.112 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_bank_ruby-0.123.112 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb
cybrid_api_id_ruby-0.123.112 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/method_name.rb