Skip to content

Commit fa6df6f

Browse files
authored
Merge pull request #66 from issyl0/a-little-human-dependabot
Bump RuboCop and fix deprecation warnings
2 parents aff5882 + 77101cd commit fa6df6f

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

graphql-client.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
1818
s.add_development_dependency "minitest", "~> 5.9"
1919
s.add_development_dependency "rake", "~> 13.2.1"
2020
s.add_development_dependency "rubocop-github"
21-
s.add_development_dependency "rubocop", "~> 1.66.1"
21+
s.add_development_dependency "rubocop", "~> 1.73.2"
2222

2323
s.required_ruby_version = ">= 2.1.0"
2424

lib/rubocop/cop/graphql/heredoc.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module RuboCop
55
module Cop
66
module GraphQL
77
# Public: Cop for enforcing non-interpolated GRAPHQL heredocs.
8-
class Heredoc < Cop
8+
class Heredoc < Base
99
def on_dstr(node)
1010
check_str(node)
1111
end
@@ -19,11 +19,11 @@ def check_str(node)
1919
return unless node.location.expression.source =~ /^<<(-|~)?GRAPHQL/
2020

2121
node.each_child_node(:begin) do |begin_node|
22-
add_offense(begin_node, location: :expression, message: "Do not interpolate variables into GraphQL queries, " \
22+
add_offense(begin_node, message: "Do not interpolate variables into GraphQL queries, " \
2323
"used variables instead.")
2424
end
2525

26-
add_offense(node, location: :expression, message: "GraphQL heredocs should be quoted. <<-'GRAPHQL'")
26+
add_offense(node, message: "GraphQL heredocs should be quoted. <<-'GRAPHQL'")
2727
end
2828

2929
def autocorrect(node)

lib/rubocop/cop/graphql/overfetch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module RuboCop
88
module Cop
99
module GraphQL
1010
# Public: Rubocop for catching overfetched fields in ERB templates.
11-
class Overfetch < Cop
11+
class Overfetch < Base
1212
if defined?(RangeHelp)
1313
# rubocop 0.53 moved the #source_range method into this module
1414
include RangeHelp
@@ -42,7 +42,7 @@ def investigate(processed_source)
4242

4343
visitor.fields.each do |field, count|
4444
next if count > 0
45-
add_offense(nil, location: visitor.ranges[field], message: "GraphQL field '#{field}' query but was not used in template.")
45+
add_offense(nil, message: "GraphQL field '#{field}' query but was not used in template.")
4646
end
4747
end
4848

test/test_client_errors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def test_errors_collection
310310
"errors" => [
311311
{
312312
"message" => "b00m",
313-
"locations" => [{"line" => 1, "column" => 3}],
313+
"locations" => [{ "line" => 1, "column" => 3 }],
314314
"path" => ["nullableError"]
315315
}
316316
]

test/test_client_schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_dump_schema_io
6161

6262
def test_dump_schema_context
6363
conn = FakeConn.new
64-
GraphQL::Client.dump_schema(conn, StringIO.new, context: { user_id: 1})
64+
GraphQL::Client.dump_schema(conn, StringIO.new, context: { user_id: 1 })
6565
assert_equal({ user_id: 1 }, conn.context)
6666
end
6767
end

test/test_query_result.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_snakecase_field_aliases
270270
GRAPHQL
271271

272272
person = Temp::Person.new(@client.query(Temp::Query).data.me)
273-
raw_result = {"firstName"=>"Joshua", "lastName"=>"Peek"}
273+
raw_result = { "firstName" => "Joshua", "lastName" => "Peek" }
274274
assert_equal raw_result, person.to_h
275275
assert_equal raw_result, person.to_hash
276276

0 commit comments

Comments
 (0)