Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RESTRICT_ON_SEND #141

Merged
merged 1 commit into from Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/rspec.yml
Expand Up @@ -20,8 +20,7 @@ jobs:
matrix:
ruby: ["3.0", 3.1, 3.2]
gemfile: [
"gemfiles/rubocop_0.87.0.gemfile",
"gemfiles/rubocop_0.89.0.gemfile",
"gemfiles/rubocop_0.90.0.gemfile",
"gemfiles/rubocop_1.0.gemfile",
"gemfiles/rubocop_edge.gemfile"
]
Expand Down
5 changes: 0 additions & 5 deletions gemfiles/rubocop_0.89.0.gemfile

This file was deleted.

@@ -1,5 +1,5 @@
source "https://rubygems.org"

gem "rubocop", "0.87.0"
gem "rubocop", "0.90.0"

gemspec path: "../"
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/argument_description.rb
Expand Up @@ -22,6 +22,7 @@ class ArgumentDescription < Base
include RuboCop::GraphQL::NodePattern

MSG = "Missing argument description"
RESTRICT_ON_SEND = %i[argument].freeze

def on_send(node)
return unless argument?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/argument_name.rb
Expand Up @@ -20,6 +20,7 @@ module GraphQL
#
class ArgumentName < Base
include RuboCop::GraphQL::NodePattern
RESTRICT_ON_SEND = %i[argument].freeze

using RuboCop::GraphQL::Ext::SnakeCase

Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/graphql/field_definitions.rb
Expand Up @@ -52,6 +52,8 @@ class FieldDefinitions < Base # rubocop:disable Metrics/ClassLength
include RuboCop::GraphQL::Sorbet
include RuboCop::GraphQL::Heredoc

RESTRICT_ON_SEND = %i[field].freeze

# @!method field_kwargs(node)
def_node_matcher :field_kwargs, <<~PATTERN
(send nil? :field
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/field_description.rb
Expand Up @@ -22,6 +22,7 @@ class FieldDescription < Base
include RuboCop::GraphQL::NodePattern

MSG = "Missing field description"
RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field_definition?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/field_hash_key.rb
Expand Up @@ -41,6 +41,7 @@ class FieldHashKey < Base
PATTERN

MSG = "Use hash_key: %<hash_key>p"
RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field_definition?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/field_method.rb
Expand Up @@ -40,6 +40,7 @@ class FieldMethod < Base
PATTERN

MSG = "Use method: :%<method_name>s"
RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field_definition?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/field_name.rb
Expand Up @@ -29,6 +29,7 @@ class FieldName < Base
using RuboCop::GraphQL::Ext::SnakeCase

MSG = "Use snake_case for field names"
RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field_definition?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/legacy_dsl.rb
Expand Up @@ -32,6 +32,7 @@ class LegacyDsl < Base

MSG = "Avoid using legacy based type-based definitions. " \
"Use class-based definitions instead."
RESTRICT_ON_SEND = %i[define].freeze

def on_send(node)
return unless node.parent.block_type?
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/graphql/multiple_field_definitions.rb
Expand Up @@ -32,6 +32,8 @@ class MultipleFieldDefinitions < Base
include RuboCop::Cop::RangeHelp
include RuboCop::GraphQL::Heredoc

RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field?(node)

Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/unnecessary_argument_camelize.rb
Expand Up @@ -44,6 +44,7 @@ class UnnecessaryArgumentCamelize < Base
include RuboCop::GraphQL::NodePattern

MSG = "Unnecessary argument camelize"
RESTRICT_ON_SEND = %i[argument].freeze

def on_send(node)
return unless argument?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/unnecessary_field_alias.rb
Expand Up @@ -25,6 +25,7 @@ class UnnecessaryFieldAlias < Base
include RuboCop::GraphQL::NodePattern

MSG = "Unnecessary :%<kwarg>s configured"
RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field_definition?(node)
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/graphql/unnecessary_field_camelize.rb
Expand Up @@ -22,6 +22,7 @@ class UnnecessaryFieldCamelize < Base
include RuboCop::GraphQL::NodePattern

MSG = "Unnecessary field camelize"
RESTRICT_ON_SEND = %i[field].freeze

def on_send(node)
return unless field_definition?(node)
Expand Down
2 changes: 1 addition & 1 deletion rubocop-graphql.gemspec
Expand Up @@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.9"

spec.add_runtime_dependency "rubocop", ">= 0.87", "< 2"
spec.add_runtime_dependency "rubocop", ">= 0.90", "< 2"
end