Skip to content

Commit fff68db

Browse files
committed
(CONT-776) - Correct Style/TernaryParentheses
1 parent 845621a commit fff68db

File tree

5 files changed

+4
-15
lines changed

5 files changed

+4
-15
lines changed

.rubocop_todo.yml

-11
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,6 @@ RSpec/StubbedMock:
156156
Exclude:
157157
- 'spec/unit/lib/facter/docker_spec.rb'
158158

159-
# Offense count: 4
160-
# This cop supports safe autocorrection (--autocorrect).
161-
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
162-
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
163-
Style/TernaryParentheses:
164-
Exclude:
165-
- 'lib/puppet/provider/docker_compose/ruby.rb'
166-
- 'lib/puppet/provider/docker_stack/ruby.rb'
167-
- 'spec/shared_examples/run.rb'
168-
- 'spec/shared_examples/services.rb'
169-
170159
# Offense count: 190
171160
# This cop supports safe autocorrection (--autocorrect).
172161
# Configuration parameters: EnforcedStyleForMultiline.

lib/puppet/provider/docker_compose/ruby.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def exists?
4545
return false if compose_services.count != compose_containers.uniq.count
4646

4747
counts = Hash[*compose_services.each.map { |key, array|
48-
image = (array['image']) ? array['image'] : get_image(key, compose_services)
48+
image = array['image'] || get_image(key, compose_services)
4949
Puppet.info("Checking for compose service #{key} #{image}")
5050
[key, compose_containers.count("'#{key}-#{image}'")]
5151
}.flatten]

lib/puppet/provider/docker_stack/ruby.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def exists?
3939
return false if stack_services.count != stack_containers.count
4040

4141
counts = Hash[*stack_services.each.map { |key, array|
42-
image = (array['image']) ? array['image'] : get_image(key, stack_services)
42+
image = array['image'] || get_image(key, stack_services)
4343
image = "#{image}:latest" unless image.include?(':')
4444
Puppet.info("Checking for compose service #{key} #{image}")
4545
["#{key}-#{image}", stack_containers.count("#{key}-#{image}")]

spec/shared_examples/run.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@
451451
'ports' => ports,
452452
'stop_wait_time' => stop_wait_time,
453453
'container_running' => running,
454-
'logfile_path' => facts[:os]['family'] == 'windows' ? facts['docker_user_temp_path'] : '/tmp',
454+
'logfile_path' => (facts[:os]['family'] == 'windows') ? facts['docker_user_temp_path'] : '/tmp',
455455
}
456456

457457
detect_changes = get_docker_params_changed(docker_params_changed_args)

spec/shared_examples/services.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
)
5858

5959
exec_create = "#{docker_command} create --name #{docker_service_create_flags}"
60-
unless_create = "docker service ps #{service_name == :undef ? '' : service_name}"
60+
unless_create = "docker service ps #{(service_name == :undef) ? '' : service_name}"
6161

6262
it {
6363
expect(subject).to contain_exec("#{title} docker service create").with(

0 commit comments

Comments
 (0)