Skip to content

Commit 17be9cb

Browse files
committed
Upgraded RuboCop to 1.80.2.
1 parent a078212 commit 17be9cb

File tree

10 files changed

+45
-13
lines changed

10 files changed

+45
-13
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
inherit_from: .rubocop_todo.yml
22

3-
require:
3+
plugins:
44
- rubocop-rake
55
- rubocop-minitest
66

.rubocop_todo.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-05-12 16:41:11 UTC using RuboCop version 1.63.5.
3+
# on 2025-09-10 13:55:47 UTC using RuboCop version 1.80.2.
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

99
# Offense count: 1
10-
# Configuration parameters: Severity, Include.
11-
# Include: **/*.gemspec
10+
# Configuration parameters: Severity.
1211
Gemspec/RequiredRubyVersion:
1312
Exclude:
1413
- 'hyperclient.gemspec'
@@ -30,16 +29,19 @@ Lint/MissingSuper:
3029

3130
# Offense count: 1
3231
# This cop supports unsafe autocorrection (--autocorrect-all).
33-
# Configuration parameters: AllowedMethods.
32+
# Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
3433
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
34+
# AdditionalNilMethods: present?, blank?, try, try!
3535
Lint/RedundantSafeNavigation:
3636
Exclude:
3737
- 'lib/hyperclient/link.rb'
3838

3939
# Offense count: 3
4040
# This cop supports unsafe autocorrection (--autocorrect-all).
41-
# Configuration parameters: EnforcedStyle.
41+
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
4242
# SupportedStyles: nested, compact
43+
# SupportedStylesForClasses: ~, nested, compact
44+
# SupportedStylesForModules: ~, nested, compact
4345
Style/ClassAndModuleChildren:
4446
Exclude:
4547
- 'features/steps/api_navigation.rb'

CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
### 2.0.1 (Next)
44

5-
* [#298](https://github.com/codegram/hyperclient/pull/298): Upgraded rubocop to 1.63.5 - [@dblock](https://github.com/dblock).
5+
* [#298](https://github.com/codegram/hyperclient/pull/300): Upgraded RuboCop to 1.80.2 - [@dblock](https://github.com/dblock).
6+
* [#298](https://github.com/codegram/hyperclient/pull/298): Upgraded RuboCop to 1.63.5 - [@dblock](https://github.com/dblock).
67
* Your contribution here.
78

89
### 2.0.0 (2024/02/01)
910

1011
* [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock).
1112
* [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock).
12-
* [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade Rubocop to 1.45 - [@dblock](https://github.com/dblock).
13+
* [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade RuboCop to 1.45 - [@dblock](https://github.com/dblock).
1314
* [#271](https://github.com/codegram/hyperclient/pull/271): Test against Ruby 3.2 - [@dblock](https://github.com/dblock).
1415
* [#285](https://github.com/codegram/hyperclient/pull/285): Support Faraday 2.x - [@dblock](https://github.com/dblock).
1516

@@ -44,14 +45,14 @@
4445
### 0.9.0 (2018/01/10)
4546

4647
* [#133](https://github.com/codegram/hyperclient/pull/133): Removed futuroscope - [@dblock](https://github.com/dblock).
47-
* [#131](https://github.com/codegram/hyperclient/pull/131): Upgrade to Rubocop 0.50.0, fix Bundler's insecure git source warning - [@nebolsin](https://github.com/nebolsin).
48+
* [#131](https://github.com/codegram/hyperclient/pull/131): Upgrade to RuboCop 0.50.0, fix Bundler's insecure git source warning - [@nebolsin](https://github.com/nebolsin).
4849
* [#132](https://github.com/codegram/hyperclient/pull/132): Swapped yard dependency for danger-toc - [@dblock](https://github.com/dblock).
4950

5051
### 0.8.6 (2017/08/27)
5152

5253
* [#122](https://github.com/codegram/hyperclient/pull/122): Improve error message when server returns invalid data - [@ivoanjo](https://github.com/ivoanjo).
5354
* [#125](https://github.com/codegram/hyperclient/pull/125): Add table of contents to readme and add note asking users to add their projects to the wiki - [@ivoanjo](https://github.com/ivoanjo).
54-
* [#127](https://github.com/codegram/hyperclient/pull/127): Minor fixes: Fix warnings, and pry-byebug to dev Gemfile and tweak rubocop execution - [@ivoanjo](https://github.com/ivoanjo).
55+
* [#127](https://github.com/codegram/hyperclient/pull/127): Minor fixes: Fix warnings, and pry-byebug to dev Gemfile and tweak RuboCop execution - [@ivoanjo](https://github.com/ivoanjo).
5556
* [#128](https://github.com/codegram/hyperclient/pull/128): Fix link delegation returning nil for field with value false - [@ivoanjo](https://github.com/ivoanjo).
5657

5758
### 0.8.5 (2017/07/05)
@@ -112,7 +113,7 @@
112113
* [#64](https://github.com/codegram/hyperclient/issues/64): Added support for curies - [@dblock](https://github.com/dblock).
113114
* [#58](https://github.com/codegram/hyperclient/issues/58): Automatically follow redirects - [@dblock](https://github.com/dblock).
114115
* [#63](https://github.com/codegram/hyperclient/pull/63): You can omit the navigational elements, `api.links.products` is now equivalent to `api.products` - [@dblock](https://github.com/dblock).
115-
* [#61](https://github.com/codegram/hyperclient/pull/61): Implemented Rubocop, Ruby-style linter - [@dblock](https://github.com/dblock).
116+
* [#61](https://github.com/codegram/hyperclient/pull/61): Implemented RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock).
116117

117118
### 0.4.0 (2014/05/05)
118119

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313

1414
group :development, :test do
1515
gem 'rake'
16-
gem 'rubocop', '~> 1.63.5', require: false
16+
gem 'rubocop', '~> 1.80.2', require: false
1717
gem 'rubocop-minitest', require: false
1818
gem 'rubocop-rake', require: false
1919
gem 'simplecov', require: false

features/support/env.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
class Spinach::FeatureSteps
1010
include Minitest::Assertions
11+
1112
attr_accessor :assertions
1213

1314
def initialize(*args)
14-
super(*args)
15+
super
1516
self.assertions = 0
1617
end
1718
end

test/hyperclient/entry_point_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ module Hyperclient
2121
it 'can update headers after a connection has been constructed' do
2222
_(entry_point.connection).must_be_kind_of Faraday::Connection
2323
entry_point.headers.update('Content-Type' => 'application/foobar')
24+
2425
_(entry_point.headers['Content-Type']).must_equal 'application/foobar'
2526
end
2627

2728
it 'can insert additional middleware after a connection has been constructed' do
2829
_(entry_point.connection).must_be_kind_of Faraday::Connection
2930
entry_point.connection.use Faraday::Request::Instrumentation
3031
handlers = entry_point.connection.builder.handlers
32+
3133
_(handlers).must_include Faraday::Request::Instrumentation
3234
end
3335

@@ -136,6 +138,7 @@ module Hyperclient
136138

137139
it 'creates a Faraday connection with the default block' do
138140
handlers = entry_point.connection.builder.handlers
141+
139142
_(handlers).wont_include Faraday::Response::RaiseError
140143
_(handlers).wont_include Faraday::FollowRedirects
141144
_(handlers).must_include Faraday::Request::Json

test/hyperclient/link_collection_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ module Hyperclient
3232

3333
describe 'plain link' do
3434
let(:plain_link) { links.self }
35+
3536
it 'must be correct' do
3637
_(plain_link._url).must_equal '/productions/1'
3738
end
3839
end
3940

4041
describe 'templated link' do
4142
let(:templated_link) { links.search }
43+
4244
it 'must expand' do
4345
_(templated_link._expand(search: 'gizmos')._url).must_equal '/productions/1?categories=gizmos'
4446
end
@@ -47,6 +49,7 @@ module Hyperclient
4749
describe 'curied link collection' do
4850
let(:curied_link) { links['image:thumbnail'] }
4951
let(:curie) { links._curies['image'] }
52+
5053
it 'must expand' do
5154
_(curied_link._expand(version: 'small')._url).must_equal '/images/thumbnails/small.jpg'
5255
end
@@ -71,6 +74,7 @@ module Hyperclient
7174

7275
describe 'null link value' do
7376
let(:null_link) { links.null_link }
77+
7478
it 'must be nil' do
7579
_(null_link).must_be_nil
7680
end

test/hyperclient/link_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ module Hyperclient
1111
describe prop do
1212
it 'returns the property value' do
1313
link = Link.new('key', { prop => 'value' }, entry_point)
14+
1415
_(link.send("_#{prop}")).must_equal 'value'
1516
end
1617

1718
it 'returns nil if the property is not present' do
1819
link = Link.new('key', {}, entry_point)
20+
1921
_(link.send("_#{prop}")).must_be_nil
2022
end
2123
end
@@ -53,11 +55,13 @@ module Hyperclient
5355
describe 'required argument' do
5456
it 'builds a Link with the templated URI representation' do
5557
link = Link.new('key', { 'href' => '/orders/{id}', 'templated' => true }, entry_point)
58+
5659
_(link._expand(id: '1')._url).must_equal '/orders/1'
5760
end
5861

5962
it 'expands an uri template without variables' do
6063
link = Link.new('key', { 'href' => '/orders/{id}', 'templated' => true }, entry_point)
64+
6165
_(link._expand._url).must_equal '/orders/'
6266
_(link._url).must_equal '/orders/'
6367
end
@@ -66,27 +70,32 @@ module Hyperclient
6670
describe 'query string argument' do
6771
it 'builds a Link with the templated URI representation' do
6872
link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point)
73+
6974
_(link._expand(id: '1')._url).must_equal '/orders?id=1'
7075
end
7176

7277
it 'expands an uri template without variables' do
7378
link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point)
79+
7480
_(link._expand._url).must_equal '/orders'
7581
_(link._url).must_equal '/orders'
7682
end
7783

7884
it 'does not expand unknown variables' do
7985
link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point)
86+
8087
_(link._expand(unknown: '1')._url).must_equal '/orders'
8188
end
8289

8390
it 'only expands known variables' do
8491
link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point)
92+
8593
_(link._expand(unknown: '1', id: '2')._url).must_equal '/orders?id=2'
8694
end
8795

8896
it 'only expands templated links' do
8997
link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => false }, entry_point)
98+
9099
_(link._expand(id: '1')._url).must_equal '/orders{?id}'
91100
end
92101
end
@@ -119,6 +128,7 @@ module Hyperclient
119128

120129
it 'returns the link when no uri template' do
121130
link = Link.new('key', { 'href' => '/orders' }, entry_point)
131+
122132
_(link._url).must_equal '/orders'
123133
end
124134

@@ -341,11 +351,13 @@ module Hyperclient
341351
it 'responds to missing methods' do
342352
resource.expects(:respond_to?).with('orders').returns(false)
343353
resource.expects(:respond_to?).with('embedded').returns(true)
354+
344355
_(link.respond_to?(:embedded)).must_equal true
345356
end
346357

347358
it 'does not delegate to_ary to resource' do
348359
resource.expects(:to_ary).never
360+
349361
_([[link, link]].flatten).must_equal [link, link]
350362
end
351363
end

test/hyperclient/resource_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ module Hyperclient
6262
it '_expand' do
6363
resource = Resource.new({ '_links' => { 'orders' => { 'href' => '/orders/{id}', 'templated' => true } } },
6464
entry_point)
65+
6566
_(resource._links.orders._expand(id: 1)._url).must_equal '/orders/1'
6667
_(resource.orders._expand(id: 1)._url).must_equal '/orders/1'
6768
_(resource.orders(id: 1)._url).must_equal '/orders/1'
@@ -94,28 +95,33 @@ module Hyperclient
9495
describe 'method_missing' do
9596
it 'delegates to attributes' do
9697
resource._attributes.expects(:foo).returns('bar')
98+
9799
_(resource.foo).must_equal 'bar'
98100
end
99101

100102
it 'delegates to links' do
101103
resource._links.expects(:foo).returns('bar')
104+
102105
_(resource.foo).must_equal 'bar'
103106
end
104107

105108
it 'delegates to embedded' do
106109
resource._embedded.expects(:foo).returns('bar')
110+
107111
_(resource.foo).must_equal 'bar'
108112
end
109113

110114
it 'delegates to attributes, links, embedded' do
111115
resource._attributes.expects('respond_to?').with('foo').returns(false)
112116
resource._links.expects('respond_to?').with('foo').returns(false)
113117
resource._embedded.expects('respond_to?').with('foo').returns(false)
118+
114119
_(-> { resource.foo }).must_raise NoMethodError
115120
end
116121

117122
it 'delegates []' do
118123
resource._attributes.expects(:foo).returns('bar')
124+
119125
_(resource['foo']).must_equal 'bar'
120126
end
121127

@@ -133,6 +139,7 @@ module Hyperclient
133139
describe 'with a default value' do
134140
it 'returns the value for keys that exist' do
135141
resource._attributes.expects(:foo).returns('bar')
142+
136143
_(resource.fetch('foo', 'default value')).must_equal 'bar'
137144
end
138145

@@ -144,6 +151,7 @@ module Hyperclient
144151
describe 'with a block' do
145152
it 'returns the value for keys that exist' do
146153
resource._attributes.expects(:foo).returns('bar')
154+
147155
_(resource.fetch('foo') { 'default value' }).must_equal 'bar'
148156
end
149157

test/hyperclient_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
it 'creates a Faraday connection with the default block plus any additional handlers' do
3333
handlers = client.connection.builder.handlers
34+
3435
_(handlers).must_include Faraday::Request::Instrumentation
3536
_(handlers).must_include Faraday::Response::RaiseError
3637
_(handlers).must_include Faraday::FollowRedirects::Middleware

0 commit comments

Comments
 (0)