Skip to content

Commit 2b5ac3a

Browse files
authored
Some Rubocop fixes (#4595)
* Use PredicatePrefix since PredicateName is deprecated * Rubocops that didn't need code changes * Enable EmptyLinesAfterModuleInclusion * Enable CollectionQuerying - had to use -A on rubocop to autofix * Revert "Enable CollectionQuerying" This reverts commit 3e1ffbc.
1 parent 99e0b1e commit 2b5ac3a

22 files changed

+40
-3
lines changed

.rubocop_cc.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,16 @@ Rails/SkipsModelValidations: # We don`t want any model at all in migrations and
143143
- spec/migrations/**/*
144144

145145
#### ENABLED SECTION
146+
Gemspec/AttributeAssignment:
147+
Enabled: true
146148
Gemspec/DeprecatedAttributeAssignment:
147149
Enabled: true
148150
Gemspec/DevelopmentDependencies:
149151
Enabled: true
150152
Gemspec/RequireMFA:
151153
Enabled: true
154+
Layout/EmptyLinesAfterModuleInclusion:
155+
Enabled: true
152156
Layout/LineContinuationLeadingSpace:
153157
Enabled: true
154158
Layout/LineContinuationSpacing:
@@ -239,8 +243,12 @@ Lint/UnexpectedBlockArity:
239243
Enabled: true
240244
Lint/UnmodifiedReduceAccumulator:
241245
Enabled: true
246+
Lint/UselessDefaultValueArgument:
247+
Enabled: true
242248
Lint/UselessDefined:
243249
Enabled: true
250+
Lint/UselessOr:
251+
Enabled: true
244252
Lint/UselessRescue:
245253
Enabled: true
246254
Lint/UselessRuby2Keywords:
@@ -259,6 +267,8 @@ Style/ArgumentsForwarding:
259267
Enabled: true
260268
Style/ArrayIntersect:
261269
Enabled: true
270+
Style/ArrayIntersectWithSingleElement:
271+
Enabled: true
262272
Style/BitwisePredicate:
263273
Enabled: true
264274
Style/CollectionCompact:
@@ -281,6 +291,8 @@ Style/DocumentDynamicEvalDefinition:
281291
Enabled: true
282292
Style/EmptyHeredoc:
283293
Enabled: true
294+
Style/EmptyStringInsideInterpolation:
295+
Enabled: true
284296
Style/EndlessMethod:
285297
Enabled: true
286298
Style/EnvHome:
@@ -349,6 +361,8 @@ Style/RedundantArgument:
349361
Enabled: true
350362
Style/RedundantArrayConstructor:
351363
Enabled: true
364+
Style/RedundantArrayFlatten:
365+
Enabled: true
352366
Style/RedundantConstantBase:
353367
Enabled: true
354368
Style/RedundantCurrentDirectoryInPath:
@@ -425,6 +439,8 @@ Rails/ExpandedDateRange:
425439
Enabled: true
426440
Rails/FindById:
427441
Enabled: true
442+
Rails/FindByOrAssignmentMemoization:
443+
Enabled: true
428444
Rails/FreezeTime:
429445
Enabled: true
430446
Rails/I18nLazyLookup:
@@ -447,6 +463,8 @@ Rails/MultipleRoutePaths:
447463
Enabled: true
448464
Rails/NegateInclude:
449465
Enabled: true
466+
Rails/OrderArguments:
467+
Enabled: true
450468
Rails/Pluck:
451469
Enabled: true
452470
Rails/PluckInWhere:

.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Naming/HeredocDelimiterNaming:
129129
# ForbiddenPrefixes: is_, has_, have_
130130
# AllowedMethods: is_a?
131131
# MethodDefinitionMacros: define_method, define_singleton_method
132-
Naming/PredicateName:
132+
Naming/PredicatePrefix:
133133
Enabled: false
134134

135135
# Offense count: 862

app/actions/services/service_instance_read.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module VCAP::CloudController
44
class ServiceInstanceRead
55
include VCAP::CloudController::LockCheck
6+
67
class NotSupportedError < ::StandardError
78
end
89

app/messages/service_broker_create_message.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
module VCAP::CloudController
1010
class ServiceBrokerCreateMessage < MetadataBaseMessage
1111
include AuthenticationMessageMixin
12+
1213
register_allowed_keys %i[name url authentication relationships]
1314

1415
def self.relationships_requested?

app/models/runtime/app_model.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
module VCAP::CloudController
77
class AppModel < Sequel::Model(:apps)
88
include Serializer
9+
910
APP_NAME_REGEX = /\A[[:alnum:][:punct:][:print:]]+\Z/
1011
DEFAULT_CONTAINER_USER = 'vcap'.freeze
1112
DEFAULT_DOCKER_CONTAINER_USER = 'root'.freeze

app/models/runtime/isolation_segment_model.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ class IsolationSegmentModel < Sequel::Model(:isolation_segments)
33
SHARED_ISOLATION_SEGMENT_GUID = '933b4c58-120b-499a-b85d-4b6fc9e2903b'.freeze
44

55
include Serializer
6+
67
ISOLATION_SEGMENT_MODEL_REGEX = /\A[[:print:]]+\Z/
78

89
one_to_many :spaces, key: :isolation_segment_guid, primary_key: :guid

app/models/runtime/task_model.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module VCAP::CloudController
22
class TaskModel < Sequel::Model(:tasks)
33
include Serializer
4+
45
TASK_NAME_REGEX = /\A[[:alnum:][:punct:][:print:]]+\Z/
56
TASK_STATES = [
67
SUCCEEDED_STATE = 'SUCCEEDED'.freeze,

app/presenters/v3/domain_presenter.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
module VCAP::CloudController::Presenters::V3
66
class DomainPresenter < BasePresenter
77
include VCAP::CloudController::Presenters::Mixins::MetadataPresentationHelpers
8+
89
def initialize(
910
resource,
1011
show_secrets: false,

config/initializers/honeycomb.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def self.honeycomb(cc_config)
1616

1717
class CustomSampler
1818
extend Honeycomb::DeterministicSampler
19+
1920
def self.sample(fields)
2021
sample_rate = 1
2122
# Remove this if you want a closer look at our DB calls

lib/cloud_controller/diego/buildpack/desired_lrp_builder.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Diego
33
module Buildpack
44
class DesiredLrpBuilder
55
include ::Diego::ActionBuilder
6+
67
class InvalidStack < StandardError; end
78

89
attr_reader :start_command, :action_user

0 commit comments

Comments
 (0)