Skip to content

Commit 931ab8f

Browse files
committed
Rubocop using 2.7
1 parent 8a395ff commit 931ab8f

File tree

8 files changed

+90
-87
lines changed

8 files changed

+90
-87
lines changed

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Layout/EndAlignment:
1313
EnforcedStyleAlignWith: variable
1414

1515
# Align the elements of a hash literal if they span more than one line.
16-
Layout/AlignHash:
16+
Layout/HashAlignment:
1717
EnforcedLastArgumentHashStyle: ignore_implicit
1818

1919
# Align the parameters of a method call if they span more than one line.
20-
Layout/AlignParameters:
20+
Layout/ParameterAlignment:
2121
EnforcedStyle: with_fixed_indentation
2222

2323
# Checks the indentation of hanging closing parentheses.

.rubocop_todo.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ Gemspec/OrderedDependencies:
2828
# SupportedHashRocketStyles: key, separator, table
2929
# SupportedColonStyles: key, separator, table
3030
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
31-
Layout/AlignHash:
31+
Layout/HashAlignment:
3232
Exclude:
3333
- 'spec/live/user_view_spec.rb'
3434

35+
Layout/LineLength:
36+
Max: 160
37+
3538
# Offense count: 17
3639
# Cop supports --auto-correct.
3740
# Configuration parameters: EnforcedStyle.
@@ -106,7 +109,7 @@ Lint/DuplicateMethods:
106109
- 'lib/zendesk_api/resource.rb'
107110

108111
# Offense count: 3
109-
Lint/HandleExceptions:
112+
Lint/SuppressedException:
110113
Exclude:
111114
- 'Rakefile'
112115
- 'spec/core/collection_spec.rb'
@@ -138,7 +141,7 @@ Lint/ShadowingOuterLocalVariable:
138141

139142
# Offense count: 10
140143
# Cop supports --auto-correct.
141-
Lint/StringConversionInInterpolation:
144+
Lint/RedundantStringCoercion:
142145
Exclude:
143146
- 'lib/zendesk_api/middleware/response/logger.rb'
144147
- 'spec/live/macro_spec.rb'
@@ -192,26 +195,6 @@ Naming/PredicateName:
192195
- 'spec/**/*'
193196
- 'lib/zendesk_api/associations.rb'
194197

195-
# Offense count: 1
196-
Performance/Caller:
197-
Exclude:
198-
- 'lib/zendesk_api/resource.rb'
199-
200-
# Offense count: 1
201-
# Cop supports --auto-correct.
202-
Performance/RedundantBlockCall:
203-
Exclude:
204-
- 'lib/zendesk_api/collection.rb'
205-
206-
# Offense count: 10
207-
# Cop supports --auto-correct.
208-
# Configuration parameters: MaxKeyValuePairs.
209-
Performance/RedundantMerge:
210-
Exclude:
211-
- 'lib/zendesk_api/associations.rb'
212-
- 'lib/zendesk_api/collection.rb'
213-
- 'spec/macros/resource_macros.rb'
214-
215198
# Offense count: 1
216199
# Cop supports --auto-correct.
217200
Security/YAMLLoad:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gem "yard"
88
gem "json", ">= 2.3.0", platforms: :ruby
99
gem "scrub_rb"
1010

11-
gem "rubocop", "~> 0.64.0", require: false
11+
gem "rubocop", "~> 0.79.0", require: false # Handling of Ruby 2.7 syntax
1212

1313
group :test do
1414
gem "webmock"

lib/zendesk_api/client.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ def build_connection
170170
builder.use ZendeskAPI::Middleware::Request::EncodeJson
171171

172172
# Should always be first in the stack
173-
builder.use ZendeskAPI::Middleware::Request::Retry, :logger => config.logger, :retry_codes => config.retry_codes, :retry_on_exception => config.retry_on_exception if config.retry
173+
if config.retry
174+
builder.use ZendeskAPI::Middleware::Request::Retry,
175+
:logger => config.logger,
176+
:retry_codes => config.retry_codes,
177+
:retry_on_exception => config.retry_on_exception
178+
end
174179
if config.raise_error_when_rate_limited
175180
builder.use ZendeskAPI::Middleware::Request::RaiseRateLimited, :logger => config.logger
176181
end

spec/core/bulk_actions_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
it 'calls the create_many endpoint' do
3535
assert_requested(:post, %r{bulk_test_resources/create_many},
36-
:body => json(:bulk_test_resources => attributes)
36+
:body => json(:bulk_test_resources => attributes)
3737
)
3838
end
3939

@@ -57,7 +57,7 @@
5757

5858
it 'calls the update_many endpoint' do
5959
assert_requested(:put, %r{bulk_test_resources/update_many\?ids=1,2,3$},
60-
:body => json(:bulk_test_resource => attributes)
60+
:body => json(:bulk_test_resource => attributes)
6161
)
6262
end
6363

@@ -77,7 +77,7 @@
7777

7878
it 'calls the update_many endpoint' do
7979
assert_requested(:put, %r{bulk_test_resources/update_many$},
80-
:body => json(:bulk_test_resources => attributes)
80+
:body => json(:bulk_test_resources => attributes)
8181
)
8282
end
8383

@@ -107,7 +107,7 @@
107107
subject
108108

109109
assert_requested(:post, %r{bulk_test_resources/create_or_update_many$},
110-
:body => json(:bulk_test_resources => attributes)
110+
:body => json(:bulk_test_resources => attributes)
111111
)
112112
end
113113

0 commit comments

Comments
 (0)