Skip to content

Commit 1aae2a5

Browse files
authored
Enable new RuboCops (#3904)
* Enable new RuboCops - autocorrect offenses (safe) - regenerate todos * Two offenses less
1 parent a0c1455 commit 1aae2a5

35 files changed

+74
-42
lines changed

.rubocop_cc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,16 @@ RSpecRails/TravelAround:
542542
Enabled: true
543543
Style/SingleLineDoEndBlock:
544544
Enabled: true
545+
Gemspec/AddRuntimeDependency:
546+
Enabled: true
547+
Style/MapIntoArray:
548+
Enabled: true
549+
Style/SendWithLiteralMethodName:
550+
Enabled: true
551+
Style/SuperArguments:
552+
Enabled: true
553+
Rails/WhereRange:
554+
Enabled: true
545555

546556
### Broken Cops that break code
547557
Lint/ShadowedException: # Breaks "bundle exec rake rubocop" if enabled

.rubocop_todo.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-07-24 13:31:59 UTC using RuboCop version 1.65.0.
3+
# on 2024-07-25 15:02:19 UTC using RuboCop version 1.65.0.
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
@@ -172,7 +172,7 @@ RSpec/BeforeAfterAll:
172172
- 'spec/unit/lib/vcap/rest_api/event_query_spec.rb'
173173
- 'spec/unit/lib/vcap/rest_api/query_spec.rb'
174174

175-
# Offense count: 6
175+
# Offense count: 4
176176
# This cop supports safe autocorrection (--autocorrect).
177177
# Configuration parameters: NegatedMatcher.
178178
RSpec/ChangeByZero:
@@ -634,6 +634,20 @@ Style/HashEachMethods:
634634
Exclude:
635635
- 'app/messages/validators/label_selector_requirement_validator.rb'
636636

637+
# Offense count: 9
638+
# This cop supports unsafe autocorrection (--autocorrect-all).
639+
Style/MapIntoArray:
640+
Exclude:
641+
- 'app/actions/space_delete.rb'
642+
- 'app/presenters/v3/relationship_presenter.rb'
643+
- 'app/presenters/v3/to_many_relationship_presenter.rb'
644+
- 'docs/v3/helpers/docs_helpers.rb'
645+
- 'lib/cloud_controller/install_buildpacks.rb'
646+
- 'lib/cloud_controller/metrics/periodic_updater.rb'
647+
- 'spec/unit/controllers/v3/isolation_segments_controller_spec.rb'
648+
- 'spec/unit/presenters/v3/relationship_presenter_spec.rb'
649+
- 'spec/unit/presenters/v3/to_many_relationship_presenter_spec.rb'
650+
637651
# Offense count: 3
638652
# This cop supports unsafe autocorrection (--autocorrect-all).
639653
Style/MapToHash:
@@ -714,6 +728,14 @@ Style/SelectByRegexp:
714728
- 'app/controllers/v3/service_instances_controller.rb'
715729
- 'app/controllers/v3/service_route_bindings_controller.rb'
716730

731+
# Offense count: 5
732+
# This cop supports unsafe autocorrection (--autocorrect-all).
733+
# Configuration parameters: AllowSend.
734+
Style/SendWithLiteralMethodName:
735+
Exclude:
736+
- 'app/jobs/runtime/orphaned_blobs_cleanup.rb'
737+
- 'app/jobs/v3/buildpack_cache_delete.rb'
738+
717739
# Offense count: 91
718740
# This cop supports unsafe autocorrection (--autocorrect-all).
719741
# Configuration parameters: Mode.

app/controllers/runtime/app_usage_events_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_filtered_dataset_for_enumeration(model, dataset, query_params, opts)
4343

4444
dataset = dataset.filter { id > previous_event.id }
4545
end
46-
super(model, dataset, query_params, opts)
46+
super
4747
end
4848
end
4949
end

app/controllers/runtime/organizations_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def before_update(org)
8585
end
8686
end
8787

88-
super(org)
88+
super
8989
end
9090

9191
def update(guid)
@@ -388,7 +388,7 @@ def after_create(organization)
388388

389389
def after_update(organization)
390390
@organization_event_repository.record_organization_update(organization, UserAuditInfo.from_context(SecurityContext), request_attrs)
391-
super(organization)
391+
super
392392
end
393393

394394
def get_current_role_guids(org)

app/controllers/runtime/routes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def get_filtered_dataset_for_enumeration(model, dataset, query_params, opts)
190190
opts[:q].delete(opts[:q][orgs_index])
191191
end
192192

193-
filtered_dataset = super(model, dataset, query_params, opts)
193+
filtered_dataset = super
194194
opts[:q] = orig_query
195195

196196
if org_guids.any?

app/controllers/runtime/shared_domains_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def before_create
4040
end
4141

4242
def after_create(domain)
43-
super(domain)
43+
super
4444
return if domain.nil?
4545
return if domain.router_group_guid.nil?
4646

app/controllers/runtime/space_quota_definitions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def before_update(quota)
4040
end
4141
end
4242

43-
super(quota)
43+
super
4444
end
4545

4646
def delete(guid)

app/controllers/runtime/spaces_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def before_update(space)
302302
end
303303
end
304304

305-
super(space)
305+
super
306306
end
307307

308308
def visible_relationship_dataset(name, obj)

app/controllers/runtime/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def inject_dependencies(dependencies)
111111

112112
# related_guid should map back to other_id
113113
def remove_related(related_guid, name, user_guid, find_model=model)
114-
response = super(related_guid, name, user_guid, find_model)
114+
response = super
115115
user = User.first(guid: user_guid)
116116
user.username = @uaa_username_lookup_client.usernames_for_ids([user.guid])[user.guid] || ''
117117

app/controllers/services/service_instances_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def get_filtered_dataset_for_enumeration(model, dataset_without_eager, query_par
344344
end
345345

346346
def add_related(guid, name, other_guid, find_model=model)
347-
return super(guid, name, other_guid, find_model) if name != :routes
347+
return super if name != :routes
348348

349349
req_body = body.string.blank? ? '{}' : body
350350

@@ -380,7 +380,7 @@ def bind_route(route_guid, instance_guid)
380380
end
381381

382382
def remove_related(guid, name, other_guid, find_model=model)
383-
return super(guid, name, other_guid, find_model) if name != :routes
383+
return super if name != :routes
384384

385385
unbind_route(other_guid, guid)
386386
end

0 commit comments

Comments
 (0)