app/models/manageiq/providers/nuage/manager_mixin.rb
Use filter_map
instead. Open
Open
amqp_hosts = [hostname] + (1..2).map { |i| args.dig("endpoints", "amqp_fallback#{i}", "hostname") }.compact
- Create a ticketCreate a ticket
- Exclude checks
Empty block detected. Open
Open
with_provider_connection(options) {}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for blocks without a body. Such empty blocks are typically an oversight or we should provide a comment be clearer what we're aiming for.
Empty lambdas and procs are ignored by default.
NOTE: For backwards compatibility, the configuration that allows/disallows
empty lambdas and procs is called AllowEmptyLambdas
, even though it also
applies to procs.
Example:
# bad
items.each { |item| }
# good
items.each { |item| puts item }
Example: AllowComments: true (default)
# good
items.each do |item|
# TODO: implement later (inner comment)
end
items.each { |item| } # TODO: implement later (inline comment)
Example: AllowComments: false
# bad
items.each do |item|
# TODO: implement later (inner comment)
end
items.each { |item| } # TODO: implement later (inline comment)
Example: AllowEmptyLambdas: true (default)
# good
allow(subject).to receive(:callable).and_return(-> {})
placeholder = lambda do
end
(callable || placeholder).call
proc { }
Proc.new { }
Example: AllowEmptyLambdas: false
# bad
allow(subject).to receive(:callable).and_return(-> {})
placeholder = lambda do
end
(callable || placeholder).call
proc { }
Proc.new { }