Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 3ab29a7

Browse files
committed
Update rubocop to 0.91.1
- Disable Lint/ConstantDefinitionInBlock because it doesn't auto correct and requires some significant restructuring since it flags class definitions. This might be a good thing to enable in the future. Authored-by: Greg Cobb <gcobb@pivotal.io>
1 parent a8a51d7 commit 3ab29a7

File tree

7 files changed

+33
-22
lines changed

7 files changed

+33
-22
lines changed

.rubocop.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,16 @@ Style/RedundantSelfAssignment:
435435

436436
Style/SoleNestedConditional:
437437
Enabled: false
438+
439+
Layout/BeginEndAlignment:
440+
Enabled: true
441+
442+
Lint/ConstantDefinitionInBlock:
443+
Enabled: false
444+
445+
Lint/IdentityComparison:
446+
Enabled: true
447+
448+
Lint/UselessTimes:
449+
Enabled: true
450+

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ group :test do
8888
gem 'rspec-rails', '~> 3.9.1'
8989
gem 'rspec-wait'
9090
gem 'rspec_api_documentation', '>= 6.1.0'
91-
gem 'rubocop', '~> 0.90.0'
91+
gem 'rubocop', '~> 0.91.1'
9292
gem 'timecop'
9393
gem 'webmock', '> 2.3.1'
9494
end

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,13 @@ GEM
395395
activesupport (>= 3.0.0)
396396
mustache (~> 1.0, >= 0.99.4)
397397
rspec (~> 3.0)
398-
rubocop (0.90.0)
398+
rubocop (0.91.1)
399399
parallel (~> 1.10)
400400
parser (>= 2.7.1.1)
401401
rainbow (>= 2.2.2, < 4.0)
402402
regexp_parser (>= 1.7)
403403
rexml
404-
rubocop-ast (>= 0.3.0, < 1.0)
404+
rubocop-ast (>= 0.4.0, < 1.0)
405405
ruby-progressbar (~> 1.7)
406406
unicode-display_width (>= 1.4.0, < 2.0)
407407
rubocop-ast (0.8.0)
@@ -567,7 +567,7 @@ DEPENDENCIES
567567
rspec-rails (~> 3.9.1)
568568
rspec-wait
569569
rspec_api_documentation (>= 6.1.0)
570-
rubocop (~> 0.90.0)
570+
rubocop (~> 0.91.1)
571571
ruby-debug-ide (>= 0.7.0.beta4)
572572
rubyzip (>= 1.3.0)
573573
scientist (~> 1.1.0)

lib/cloud_controller/config.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,18 @@ def kubernetes_workloads_namespace
153153

154154
def kubernetes_ca_cert
155155
@kubernetes_ca_cert ||= begin
156-
ensure_k8s_api_configured!
157-
file = get(:kubernetes, :ca_file)
158-
File.read(file)
159-
end
156+
ensure_k8s_api_configured!
157+
file = get(:kubernetes, :ca_file)
158+
File.read(file)
159+
end
160160
end
161161

162162
def kubernetes_service_account_token
163163
@kubernetes_service_account_token ||= begin
164-
ensure_k8s_api_configured!
165-
file = get(:kubernetes, :service_account, :token_file)
166-
File.read(file)
167-
end
164+
ensure_k8s_api_configured!
165+
file = get(:kubernetes, :service_account, :token_file)
166+
File.read(file)
167+
end
168168
end
169169

170170
def package_image_registry_configured?

spec/api/documentation/shared_domain_api_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:admin_auth_header) { admin_headers['HTTP_AUTHORIZATION'] }
66
let(:guid) { VCAP::CloudController::SharedDomain.first.guid }
77
let!(:domains) { 3.times { VCAP::CloudController::SharedDomain.make } }
8-
let!(:tcp_domains) { 1.times { VCAP::CloudController::SharedDomain.make router_group_guid: 'my-random-guid' } }
8+
let!(:tcp_domains) { VCAP::CloudController::SharedDomain.make router_group_guid: 'my-random-guid' }
99

1010
authenticated_request
1111

spec/request/service_route_bindings_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
instance = VCAP::CloudController::UserProvidedServiceInstance.make(:routing)
123123
other_instance = VCAP::CloudController::UserProvidedServiceInstance.make(:routing)
124124

125-
1.times { VCAP::CloudController::RouteBinding.make(service_instance: instance) }
125+
VCAP::CloudController::RouteBinding.make(service_instance: instance)
126126
2.times { VCAP::CloudController::RouteBinding.make(service_instance: other_instance) }
127127

128128
get '/v3/service_route_bindings?include=service_instance', nil, admin_headers
@@ -137,10 +137,8 @@
137137
route = VCAP::CloudController::Route.make
138138
other_route = VCAP::CloudController::Route.make
139139

140-
1.times do
141-
si = VCAP::CloudController::ManagedServiceInstance.make(:routing, space: route.space)
142-
VCAP::CloudController::RouteBinding.make(route: route, service_instance: si)
143-
end
140+
si = VCAP::CloudController::ManagedServiceInstance.make(:routing, space: route.space)
141+
VCAP::CloudController::RouteBinding.make(route: route, service_instance: si)
144142

145143
2.times do
146144
si = VCAP::CloudController::ManagedServiceInstance.make(:routing, space: other_route.space)

spec/unit/lib/cloud_controller/encryptor_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ module VCAP::CloudController
155155

156156
result = begin
157157
Encryptor.decrypt(encrypted_string, salt, iterations: encryption_iterations)
158-
rescue OpenSSL::Cipher::CipherError => e
159-
e.message
158+
rescue OpenSSL::Cipher::CipherError => e
159+
e.message
160160
end
161161

162162
expect(result).not_to eq(unencrypted_string)
@@ -169,8 +169,8 @@ module VCAP::CloudController
169169

170170
result = begin
171171
Encryptor.decrypt(encrypted_string, salt, label: 'death', iterations: encryption_iterations)
172-
rescue OpenSSL::Cipher::CipherError => e
173-
e.message
172+
rescue OpenSSL::Cipher::CipherError => e
173+
e.message
174174
end
175175

176176
expect(result).not_to eq(unencrypted_string)

0 commit comments

Comments
 (0)