Class: RuboCop::Cop::GraphQL::ArgumentName
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::GraphQL::ArgumentName
- Includes:
- GraphQL::NodePattern
- Defined in:
- lib/rubocop/cop/graphql/argument_name.rb
Overview
This cop checks whether field names are snake_case.
Constant Summary collapse
- RESTRICT_ON_SEND =
i[argument].freeze
- MSG =
"Use snake_case for argument names"
Instance Method Summary collapse
Methods included from GraphQL::NodePattern
#argument?, #field?, #field_definition?, #field_definition_with_body?
Instance Method Details
#on_send(node) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/rubocop/cop/graphql/argument_name.rb', line 29 def on_send(node) return unless argument?(node) argument = RuboCop::GraphQL::Argument.new(node) return if argument.name.snake_case? add_offense(node) end |