Skip to content

Commit c144b74

Browse files
authored
Updates Rubocop's TODO file (#445)
* Update .rubocop_todo.yml * [Corrected] Style/HashSyntax: Omit the hash value * [Corrected] Style/ArgumentsForwarding: Use anonymous positional arguments forwarding (*). * Update dnsimple.gemspec
1 parent cb6eb3c commit c144b74

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins:
99
- rubocop-rspec
1010

1111
AllCops:
12-
TargetRubyVersion: 3.0
12+
TargetRubyVersion: 3.2
1313
Exclude:
1414
- '*.gemspec'
1515
- 'Rakefile'

.rubocop_todo.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-01-26 12:48:02 UTC using RuboCop version 1.44.1.
3+
# on 2025-12-27 17:14:14 UTC using RuboCop version 1.82.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 74
9+
# Offense count: 90
1010
# Configuration parameters: CountAsOne.
1111
RSpec/ExampleLength:
1212
Max: 17
@@ -22,11 +22,11 @@ RSpec/LeakyConstantDeclaration:
2222
RSpec/MessageSpies:
2323
EnforcedStyle: receive
2424

25-
# Offense count: 115
25+
# Offense count: 134
2626
RSpec/MultipleExpectations:
2727
Max: 15
2828

29-
# Offense count: 372
29+
# Offense count: 422
3030
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
3131
# SupportedStyles: always, named_only
3232
RSpec/NamedSubject:
@@ -48,7 +48,7 @@ RSpec/SubjectStub:
4848
- 'spec/dnsimple/client/zones_spec.rb'
4949
- 'spec/dnsimple/client_spec.rb'
5050

51-
# Offense count: 69
51+
# Offense count: 83
5252
# Configuration parameters: AllowedConstants.
5353
Style/Documentation:
5454
Enabled: false

dnsimple.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
1111
s.summary = 'The DNSimple API client for Ruby'
1212
s.description = 'The DNSimple API client for Ruby.'
1313

14-
s.required_ruby_version = ">= 2.7"
14+
s.required_ruby_version = ['>= 3.2', '< 4']
1515

1616
s.require_paths = ['lib']
1717
s.files = `git ls-files`.split("\n")

lib/dnsimple/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def add_proxy_options!(options)
229229

230230
def add_auth_options!(options)
231231
if password
232-
options[:basic_auth] = { username: username, password: password }
232+
options[:basic_auth] = { username:, password: }
233233
elsif access_token
234234
options[:headers][HEADER_AUTHORIZATION] = "Bearer #{access_token}"
235235
end

lib/dnsimple/client/identity.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ module StaticHelpers
2626
# @param [Array] args the args for the {Identity#whoami} call
2727
# @return [Hash]
2828
# @raise [Dnsimple::RequestError]
29-
def whoami(client, *args)
30-
client.identity.whoami(*args).data
29+
def whoami(client, *)
30+
client.identity.whoami(*).data
3131
end
3232
end
3333
end

lib/dnsimple/client/oauth.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Oauth
1313
# @option options [String] :redirect_uri The redirect URL sent for the authorization, used to validate the request.
1414
# @return [String] The url to redirect the user to authorize.
1515
def exchange_authorization_for_token(code, client_id, client_secret, options = {})
16-
attributes = { code: code, client_id: client_id, client_secret: client_secret, grant_type: "authorization_code" }
16+
attributes = { code:, client_id:, client_secret:, grant_type: "authorization_code" }
1717
attributes[:state] = options.delete(:state) if options.key?(:state)
1818
attributes[:redirect_uri] = options.delete(:redirect_uri) if options.key?(:redirect_uri)
1919
response = client.post(Client.versioned("/oauth/access_token"), attributes, options)

lib/dnsimple/client/zones_records.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def batch_change_zone_records(account_id, zone_id, attributes, options = {})
185185
deletes_data = response["data"]["deletes"] || []
186186
deletes = deletes_data.map { |r| Struct::ZoneRecordId.new(r) }
187187
end
188-
Dnsimple::Response.new(response, Struct::ZoneRecordsBatchChange.new({ creates: creates, updates: updates, deletes: deletes }))
188+
Dnsimple::Response.new(response, Struct::ZoneRecordsBatchChange.new({ creates:, updates:, deletes: }))
189189
end
190190
end
191191
end

lib/dnsimple/extra.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def self.join_uri(*parts)
2323
# h2 = { b: 250, c: { c1: 200 } }
2424
# Extra.deep_merge(h1, h2) { |key, this_val, other_val| this_val + other_val }
2525
# # => { a: 100, b: 450, c: { c1: 300 } }
26-
def self.deep_merge(this, other, &block)
27-
deep_merge!(this.dup, other, &block)
26+
def self.deep_merge(this, other, &)
27+
deep_merge!(this.dup, other, &)
2828
end
2929

3030
# Same as +deep_merge+, but modifies +this+ instead of returning a new hash.

lib/dnsimple/options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _prepare_filter
4848

4949
def _prepare_groupings
5050
groupings = @options.delete(:groupings)
51-
_merge({ groupings: groupings }) unless groupings.nil?
51+
_merge({ groupings: }) unless groupings.nil?
5252
end
5353

5454
def _merge(hash)

spec/dnsimple/client/oauth_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
end
2020

2121
it "builds the correct request" do
22-
subject.exchange_authorization_for_token(code, client_id, client_secret, state: state)
22+
subject.exchange_authorization_for_token(code, client_id, client_secret, state:)
2323

2424
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/oauth/access_token")
25-
.with(body: { client_id: client_id, client_secret: client_secret, code: code, state: state, grant_type: "authorization_code" })
25+
.with(body: { client_id:, client_secret:, code:, state:, grant_type: "authorization_code" })
2626
.with(headers: { "Accept" => "application/json" })
2727
end
2828

2929
it "returns oauth token" do
30-
result = subject.exchange_authorization_for_token(code, client_id, client_secret, state: state)
30+
result = subject.exchange_authorization_for_token(code, client_id, client_secret, state:)
3131

3232
expect(result).to be_a(Dnsimple::Struct::OauthToken)
3333
expect(result.access_token).to eq("zKQ7OLqF5N1gylcJweA9WodA000BUNJD")
@@ -39,10 +39,10 @@
3939
let(:redirect_uri) { "super-redirect-uri" }
4040

4141
it "builds the correct request" do
42-
subject.exchange_authorization_for_token(code, client_id, client_secret, state: state, redirect_uri: redirect_uri)
42+
subject.exchange_authorization_for_token(code, client_id, client_secret, state:, redirect_uri:)
4343

4444
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/oauth/access_token")
45-
.with(body: { client_id: client_id, client_secret: client_secret, code: code, state: state, redirect_uri: redirect_uri, grant_type: "authorization_code" })
45+
.with(body: { client_id:, client_secret:, code:, state:, redirect_uri:, grant_type: "authorization_code" })
4646
.with(headers: { "Accept" => "application/json" })
4747
end
4848
end
@@ -55,7 +55,7 @@
5555

5656
it "raises OAuthInvalidRequestError" do
5757
expect {
58-
subject.exchange_authorization_for_token(code, client_id, client_secret, state: state)
58+
subject.exchange_authorization_for_token(code, client_id, client_secret, state:)
5959
}.to raise_error(Dnsimple::OAuthInvalidRequestError) do |e|
6060
error = "invalid_request"
6161
error_description = "Invalid \"state\": value doesn't match the \"state\" in the authorization request"

0 commit comments

Comments
 (0)