Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .rubocop_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,16 @@ Rails/SkipsModelValidations: # We don`t want any model at all in migrations and
- spec/migrations/**/*

#### ENABLED SECTION
Gemspec/AttributeAssignment:
Enabled: true
Gemspec/DeprecatedAttributeAssignment:
Enabled: true
Gemspec/DevelopmentDependencies:
Enabled: true
Gemspec/RequireMFA:
Enabled: true
Layout/EmptyLinesAfterModuleInclusion:
Enabled: true
Layout/LineContinuationLeadingSpace:
Enabled: true
Layout/LineContinuationSpacing:
Expand Down Expand Up @@ -239,8 +243,12 @@ Lint/UnexpectedBlockArity:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Lint/UselessDefaultValueArgument:
Enabled: true
Lint/UselessDefined:
Enabled: true
Lint/UselessOr:
Enabled: true
Lint/UselessRescue:
Enabled: true
Lint/UselessRuby2Keywords:
Expand All @@ -259,6 +267,8 @@ Style/ArgumentsForwarding:
Enabled: true
Style/ArrayIntersect:
Enabled: true
Style/ArrayIntersectWithSingleElement:
Enabled: true
Style/BitwisePredicate:
Enabled: true
Style/CollectionCompact:
Expand All @@ -281,6 +291,8 @@ Style/DocumentDynamicEvalDefinition:
Enabled: true
Style/EmptyHeredoc:
Enabled: true
Style/EmptyStringInsideInterpolation:
Enabled: true
Style/EndlessMethod:
Enabled: true
Style/EnvHome:
Expand Down Expand Up @@ -349,6 +361,8 @@ Style/RedundantArgument:
Enabled: true
Style/RedundantArrayConstructor:
Enabled: true
Style/RedundantArrayFlatten:
Enabled: true
Style/RedundantConstantBase:
Enabled: true
Style/RedundantCurrentDirectoryInPath:
Expand Down Expand Up @@ -425,6 +439,8 @@ Rails/ExpandedDateRange:
Enabled: true
Rails/FindById:
Enabled: true
Rails/FindByOrAssignmentMemoization:
Enabled: true
Rails/FreezeTime:
Enabled: true
Rails/I18nLazyLookup:
Expand All @@ -447,6 +463,8 @@ Rails/MultipleRoutePaths:
Enabled: true
Rails/NegateInclude:
Enabled: true
Rails/OrderArguments:
Enabled: true
Rails/Pluck:
Enabled: true
Rails/PluckInWhere:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Naming/HeredocDelimiterNaming:
# ForbiddenPrefixes: is_, has_, have_
# AllowedMethods: is_a?
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicateName:
Naming/PredicatePrefix:
Enabled: false

# Offense count: 862
Expand Down
1 change: 1 addition & 0 deletions app/actions/services/service_instance_read.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module VCAP::CloudController
class ServiceInstanceRead
include VCAP::CloudController::LockCheck

class NotSupportedError < ::StandardError
end

Expand Down
1 change: 1 addition & 0 deletions app/messages/service_broker_create_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
module VCAP::CloudController
class ServiceBrokerCreateMessage < MetadataBaseMessage
include AuthenticationMessageMixin

register_allowed_keys %i[name url authentication relationships]

def self.relationships_requested?
Expand Down
1 change: 1 addition & 0 deletions app/models/runtime/app_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module VCAP::CloudController
class AppModel < Sequel::Model(:apps)
include Serializer

APP_NAME_REGEX = /\A[[:alnum:][:punct:][:print:]]+\Z/
DEFAULT_CONTAINER_USER = 'vcap'.freeze
DEFAULT_DOCKER_CONTAINER_USER = 'root'.freeze
Expand Down
1 change: 1 addition & 0 deletions app/models/runtime/isolation_segment_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class IsolationSegmentModel < Sequel::Model(:isolation_segments)
SHARED_ISOLATION_SEGMENT_GUID = '933b4c58-120b-499a-b85d-4b6fc9e2903b'.freeze

include Serializer

ISOLATION_SEGMENT_MODEL_REGEX = /\A[[:print:]]+\Z/

one_to_many :spaces, key: :isolation_segment_guid, primary_key: :guid
Expand Down
1 change: 1 addition & 0 deletions app/models/runtime/task_model.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module VCAP::CloudController
class TaskModel < Sequel::Model(:tasks)
include Serializer

TASK_NAME_REGEX = /\A[[:alnum:][:punct:][:print:]]+\Z/
TASK_STATES = [
SUCCEEDED_STATE = 'SUCCEEDED'.freeze,
Expand Down
1 change: 1 addition & 0 deletions app/presenters/v3/domain_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
module VCAP::CloudController::Presenters::V3
class DomainPresenter < BasePresenter
include VCAP::CloudController::Presenters::Mixins::MetadataPresentationHelpers

def initialize(
resource,
show_secrets: false,
Expand Down
1 change: 1 addition & 0 deletions config/initializers/honeycomb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def self.honeycomb(cc_config)

class CustomSampler
extend Honeycomb::DeterministicSampler

def self.sample(fields)
sample_rate = 1
# Remove this if you want a closer look at our DB calls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Diego
module Buildpack
class DesiredLrpBuilder
include ::Diego::ActionBuilder

class InvalidStack < StandardError; end

attr_reader :start_command, :action_user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Diego
module Buildpack
class TaskActionBuilder
include ::Diego::ActionBuilder

class InvalidStack < StandardError; end

def initialize(config, task, lifecycle_data, run_user, launcher_args, prefix)
Expand Down
1 change: 1 addition & 0 deletions lib/cloud_controller/diego/cnb/desired_lrp_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Diego
module CNB
class DesiredLrpBuilder
include ::Diego::ActionBuilder

class InvalidStack < StandardError; end

attr_reader :start_command, :action_user
Expand Down
1 change: 1 addition & 0 deletions lib/cloud_controller/diego/reporters/instances_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module VCAP::CloudController
module Diego
class InstancesReporter
include ReporterMixins

InstanceCountSummary = Struct.new(:starting_instances_count, :routable_instances_count, :healthy_instances_count, :unhealthy_instances_count)
HEALTHY_STATES = [VCAP::CloudController::Diego::LRP_RUNNING, VCAP::CloudController::Diego::LRP_STARTING].freeze
UNKNOWN_INSTANCE_COUNT = -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RSpec.describe 'Service Broker API integration' do
describe 'v2.14' do
include VCAP::CloudController::BrokerApiHelper

let(:catalog) { default_catalog }

before do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RSpec.describe 'Service Broker API integration' do
describe 'v2.8' do
include VCAP::CloudController::BrokerApiHelper

let(:route) { VCAP::CloudController::Route.make(space: @space) }
let(:catalog) { default_catalog(requires: ['route_forwarding']) }
let(:service_broker_bind_request) { %r{.*/v2/service_instances/#{@service_instance_guid}/service_bindings/#{guid_pattern}} }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
'broker_api_v2.5_spec.rb' => '4cbc9df341ba86c2f1791b1a4870547c',
'broker_api_v2.6_spec.rb' => 'a1608878f601819c90b44be5f317ec44',
'broker_api_v2.7_spec.rb' => '2160e3d4985039f8fd2881106c7226ae',
'broker_api_v2.8_spec.rb' => '2b1b662b4874f5bac4481de7cf15b363',
'broker_api_v2.8_spec.rb' => '4cf48cbdd3db911c2c3a648ecc0475b8',
'broker_api_v2.9_spec.rb' => '002089c49e4c2db32689be56d48d4a45',
'broker_api_v2.10_spec.rb' => '2668e6821e9b45ab6d7c7e9eca9deb68',
'broker_api_v2.11_spec.rb' => '99e61dc50ceb635b09b3bd16901a4fa6',
'broker_api_v2.12_spec.rb' => '6be5f9646bf885498dd88c090fbed7af',
'broker_api_v2.13_spec.rb' => 'b8423b9f28e68adbc3c767b2185561c5',
'broker_api_v2.14_spec.rb' => '62a84db32d01bedd0b20f37ebfcb17a0',
'broker_api_v2.14_spec.rb' => '73b5de4f83d280d959eb9844c19a3018',
'broker_api_v2.15_spec.rb' => 'c8c910e903636d1a82e5a77fcdc1fbab'
}
end
Expand Down
1 change: 1 addition & 0 deletions spec/messages/nested_message_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def error_key

class SampleActiveModel
include ActiveModel::Model

validates_with CompleteValidator
attr_accessor :data
end
Expand Down
1 change: 1 addition & 0 deletions spec/unit/lib/cloud_controller/encryptor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ module VCAP::CloudController
let(:base_class) do
Class.new do
include VCAP::CloudController::Encryptor::FieldEncryptor

def self.columns
raise '<dynamic class>.columns: not implemented'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module VCAP::CloudController::Validators
let(:class_with_authentication) do
Class.new do
include ActiveModel::Model

validates_with AuthenticationValidator

attr_accessor :authentication
Expand Down
1 change: 1 addition & 0 deletions spec/unit/messages/validators/metadata_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module VCAP::CloudController::Validators
let(:class_with_metadata) do
Class.new do
include ActiveModel::Model

validates_with MetadataValidator

attr_accessor :metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module VCAP::CloudController::Validators
let(:class_with_rules) do
Class.new do
include ActiveModel::Model

validates_with RulesValidator

def self.name
Expand Down
1 change: 1 addition & 0 deletions spec/unit/messages/validators/url_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module VCAP::CloudController::Validators
let(:class_with_url) do
Class.new do
include ActiveModel::Model

validates_with UrlValidator

attr_accessor :url
Expand Down