diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index ffb76fd..7ea8a79 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -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" ] diff --git a/gemfiles/rubocop_0.89.0.gemfile b/gemfiles/rubocop_0.89.0.gemfile deleted file mode 100644 index 5ed5517..0000000 --- a/gemfiles/rubocop_0.89.0.gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "rubocop", "0.89.1" - -gemspec path: "../" diff --git a/gemfiles/rubocop_0.87.0.gemfile b/gemfiles/rubocop_0.90.0.gemfile similarity index 68% rename from gemfiles/rubocop_0.87.0.gemfile rename to gemfiles/rubocop_0.90.0.gemfile index f3d2367..50902c7 100644 --- a/gemfiles/rubocop_0.87.0.gemfile +++ b/gemfiles/rubocop_0.90.0.gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -gem "rubocop", "0.87.0" +gem "rubocop", "0.90.0" gemspec path: "../" diff --git a/lib/rubocop/cop/graphql/argument_description.rb b/lib/rubocop/cop/graphql/argument_description.rb index f954ade..330e2c0 100644 --- a/lib/rubocop/cop/graphql/argument_description.rb +++ b/lib/rubocop/cop/graphql/argument_description.rb @@ -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) diff --git a/lib/rubocop/cop/graphql/argument_name.rb b/lib/rubocop/cop/graphql/argument_name.rb index 1c348ce..2b5e197 100644 --- a/lib/rubocop/cop/graphql/argument_name.rb +++ b/lib/rubocop/cop/graphql/argument_name.rb @@ -20,6 +20,7 @@ module GraphQL # class ArgumentName < Base include RuboCop::GraphQL::NodePattern + RESTRICT_ON_SEND = %i[argument].freeze using RuboCop::GraphQL::Ext::SnakeCase diff --git a/lib/rubocop/cop/graphql/field_definitions.rb b/lib/rubocop/cop/graphql/field_definitions.rb index dfc1ef7..e83cc12 100644 --- a/lib/rubocop/cop/graphql/field_definitions.rb +++ b/lib/rubocop/cop/graphql/field_definitions.rb @@ -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 diff --git a/lib/rubocop/cop/graphql/field_description.rb b/lib/rubocop/cop/graphql/field_description.rb index 672e407..74cb228 100644 --- a/lib/rubocop/cop/graphql/field_description.rb +++ b/lib/rubocop/cop/graphql/field_description.rb @@ -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) diff --git a/lib/rubocop/cop/graphql/field_hash_key.rb b/lib/rubocop/cop/graphql/field_hash_key.rb index bb8b02b..e1621f5 100644 --- a/lib/rubocop/cop/graphql/field_hash_key.rb +++ b/lib/rubocop/cop/graphql/field_hash_key.rb @@ -41,6 +41,7 @@ class FieldHashKey < Base PATTERN MSG = "Use hash_key: %p" + RESTRICT_ON_SEND = %i[field].freeze def on_send(node) return unless field_definition?(node) diff --git a/lib/rubocop/cop/graphql/field_method.rb b/lib/rubocop/cop/graphql/field_method.rb index 8e88515..ef83da6 100644 --- a/lib/rubocop/cop/graphql/field_method.rb +++ b/lib/rubocop/cop/graphql/field_method.rb @@ -40,6 +40,7 @@ class FieldMethod < Base PATTERN MSG = "Use method: :%s" + RESTRICT_ON_SEND = %i[field].freeze def on_send(node) return unless field_definition?(node) diff --git a/lib/rubocop/cop/graphql/field_name.rb b/lib/rubocop/cop/graphql/field_name.rb index 30d0c34..b98e51b 100644 --- a/lib/rubocop/cop/graphql/field_name.rb +++ b/lib/rubocop/cop/graphql/field_name.rb @@ -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) diff --git a/lib/rubocop/cop/graphql/legacy_dsl.rb b/lib/rubocop/cop/graphql/legacy_dsl.rb index fe1e62f..1dfb4ce 100644 --- a/lib/rubocop/cop/graphql/legacy_dsl.rb +++ b/lib/rubocop/cop/graphql/legacy_dsl.rb @@ -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? diff --git a/lib/rubocop/cop/graphql/multiple_field_definitions.rb b/lib/rubocop/cop/graphql/multiple_field_definitions.rb index 0b1c9cc..3bb67f6 100644 --- a/lib/rubocop/cop/graphql/multiple_field_definitions.rb +++ b/lib/rubocop/cop/graphql/multiple_field_definitions.rb @@ -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) diff --git a/lib/rubocop/cop/graphql/unnecessary_argument_camelize.rb b/lib/rubocop/cop/graphql/unnecessary_argument_camelize.rb index f8f40e2..e247f1f 100644 --- a/lib/rubocop/cop/graphql/unnecessary_argument_camelize.rb +++ b/lib/rubocop/cop/graphql/unnecessary_argument_camelize.rb @@ -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) diff --git a/lib/rubocop/cop/graphql/unnecessary_field_alias.rb b/lib/rubocop/cop/graphql/unnecessary_field_alias.rb index 62fc488..c5b36c6 100644 --- a/lib/rubocop/cop/graphql/unnecessary_field_alias.rb +++ b/lib/rubocop/cop/graphql/unnecessary_field_alias.rb @@ -25,6 +25,7 @@ class UnnecessaryFieldAlias < Base include RuboCop::GraphQL::NodePattern MSG = "Unnecessary :%s configured" + RESTRICT_ON_SEND = %i[field].freeze def on_send(node) return unless field_definition?(node) diff --git a/lib/rubocop/cop/graphql/unnecessary_field_camelize.rb b/lib/rubocop/cop/graphql/unnecessary_field_camelize.rb index c348431..93aa247 100644 --- a/lib/rubocop/cop/graphql/unnecessary_field_camelize.rb +++ b/lib/rubocop/cop/graphql/unnecessary_field_camelize.rb @@ -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) diff --git a/rubocop-graphql.gemspec b/rubocop-graphql.gemspec index 1e44c20..89fa89c 100644 --- a/rubocop-graphql.gemspec +++ b/rubocop-graphql.gemspec @@ -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