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

Commit 50c8f51

Browse files
committed
Update rubocop to 0.82.0
Authored-by: Greg Cobb <gcobb@pivotal.io>
1 parent fbbe925 commit 50c8f51

12 files changed

Lines changed: 22 additions & 16 deletions

File tree

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,9 @@ Lint/RaiseException:
313313
Lint/StructNewOverride:
314314
Enabled: true
315315

316+
Layout/SpaceAroundMethodCallOperator:
317+
Enabled: true
318+
319+
Style/ExponentialNotation:
320+
Enabled: true
321+

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.81.0'
91+
gem 'rubocop', '~> 0.82.0'
9292
gem 'timecop'
9393
gem 'webmock', '> 2.3.1'
9494
end

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ GEM
394394
activesupport (>= 3.0.0)
395395
mustache (~> 1.0, >= 0.99.4)
396396
rspec (~> 3.0)
397-
rubocop (0.81.0)
397+
rubocop (0.82.0)
398398
jaro_winkler (~> 1.5.1)
399399
parallel (~> 1.10)
400400
parser (>= 2.7.0.1)
@@ -563,7 +563,7 @@ DEPENDENCIES
563563
rspec-rails (~> 3.9.1)
564564
rspec-wait
565565
rspec_api_documentation (>= 6.1.0)
566-
rubocop (~> 0.81.0)
566+
rubocop (~> 0.82.0)
567567
ruby-debug-ide (>= 0.7.0.beta4)
568568
rubyzip (>= 1.3.0)
569569
scientist (~> 1.1.0)

lib/sequel_plugins/vcap_validations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module InstanceMethods
55
# @param [Symbol] The attribute to validate
66
def validates_url(attr, opts={})
77
if send(attr)
8-
validates_format(URI.regexp(%w(http https)), attr, message: opts.fetch(:message, :url))
8+
validates_format(URI::DEFAULT_PARSER.make_regexp(%w(http https)), attr, message: opts.fetch(:message, :url))
99
end
1010
end
1111

lib/services/service_brokers/v2/response_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def validate(method:, uri:, code:, response:)
659659
parameters = parsed_response['parameters']
660660

661661
if parameters && !parameters.is_a?(Hash)
662-
raise Errors::ServiceBrokerResponseMalformed. new(uri, method, response,
662+
raise Errors::ServiceBrokerResponseMalformed.new(uri, method, response,
663663
'The service broker response contained a parameters field that was not a JSON object.')
664664
end
665665

lib/vcap/rest_api/message.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def self.schema_doc(schema)
2828
schema.deparse
2929
end
3030

31-
URL = readable_regexp(URI.regexp(%w(http https)),
31+
URL = readable_regexp(URI::DEFAULT_PARSER.make_regexp(%w(http https)),
3232
'String /URL_REGEX/',
3333
'must be a valid URL')
3434
HTTPS_URL = readable_regexp(URI::DEFAULT_PARSER.make_regexp('https'),
@@ -37,7 +37,7 @@ def self.schema_doc(schema)
3737
EMAIL = readable_regexp(RFC822::EMAIL_REGEXP_WHOLE,
3838
'String /EMAIL_REGEX/',
3939
'must be a valid email')
40-
GIT_URL = readable_regexp(URI.regexp(%w(http https git)),
40+
GIT_URL = readable_regexp(URI::DEFAULT_PARSER.make_regexp(%w(http https git)),
4141
'String /GIT_URL_REGEX/',
4242
'must be a valid git URL')
4343

lib/vcap/services/api/messages.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class EmptyRequest < JsonMessage
1818
#
1919
class ServiceOfferingRequest < JsonMessage
2020
required :label, SERVICE_LABEL_REGEX
21-
required :url, URI.regexp(%w(http https))
21+
required :url, URI::DEFAULT_PARSER.make_regexp(%w(http https))
2222
required :supported_versions, [String]
2323
required :version_aliases, Hash
2424

2525
optional :description, String
26-
optional :info_url, URI.regexp(%w(http https))
26+
optional :info_url, URI::DEFAULT_PARSER.make_regexp(%w(http https))
2727
optional :tags, [String]
2828
optional :plan_details do
2929
[
@@ -197,7 +197,7 @@ class Job < JsonMessage
197197
end
198198

199199
class SerializedURL < JsonMessage
200-
required :url, URI.regexp(%w(http https))
200+
required :url, URI::DEFAULT_PARSER.make_regexp(%w(http https))
201201
end
202202

203203
class SerializedData < JsonMessage

spec/request/app_manifests_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@
588588
let!(:app_annotation) { VCAP::CloudController::AppAnnotationModel.make(resource_guid: app_model.guid, key: 'style', value: 'mashed') }
589589

590590
let!(:sidecar1) { VCAP::CloudController::SidecarModel.make(name: 'authenticator', command: './authenticator', app: app_model) }
591-
let!(:sidecar2) { VCAP::CloudController:: SidecarModel.make(name: 'my_sidecar', command: 'rackup', app: app_model) }
591+
let!(:sidecar2) { VCAP::CloudController::SidecarModel.make(name: 'my_sidecar', command: 'rackup', app: app_model) }
592592

593593
let!(:sidecar_process_type1) { VCAP::CloudController::SidecarProcessTypeModel.make(type: 'worker', sidecar: sidecar1, app_guid: app_model.guid) }
594594
let!(:sidecar_process_type2) { VCAP::CloudController::SidecarProcessTypeModel.make(type: 'web', sidecar: sidecar1, app_guid: app_model.guid) }

spec/unit/lib/cloud_controller/diego/task_recipe_builder_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ module Diego
269269

270270
it 'sets the network information' do
271271
result = task_recipe_builder.build_staging_task(config, staging_details)
272-
expect(result.network). to eq(expected_network)
272+
expect(result.network).to eq(expected_network)
273273
end
274274

275275
it 'sets the egress rules' do
@@ -472,7 +472,7 @@ module Diego
472472
expect(result.legacy_download_user).to eq('vcap')
473473
expect(result.root_fs).to eq('preloaded:potato-stack')
474474
expect(result.completion_callback_url).to eq(expected_callback_url)
475-
expect(result.network). to eq(expected_network)
475+
expect(result.network).to eq(expected_network)
476476
expect(result.privileged).to be(false)
477477
expect(result.volume_mounts).to eq([])
478478
expect(result.egress_rules).to eq([

spec/unit/messages/packages_list_message_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ module VCAP::CloudController
163163
it 'is not valid if guids is not an array' do
164164
message = PackagesListMessage.from_params guids: 'tricked you, not an array'
165165
expect(message).to be_invalid
166-
expect(message.errors[:guids]). to include('must be an array')
166+
expect(message.errors[:guids]).to include('must be an array')
167167
end
168168

169169
it 'allows guids to be nil' do

0 commit comments

Comments
 (0)