Skip to content

Commit d4cbe2c

Browse files
committed
(CONT-776) - Correct Style/TrailingCommaInHashLiteral
1 parent fff68db commit d4cbe2c

23 files changed

+190
-197
lines changed

.rubocop_todo.yml

-7
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,3 @@ RSpec/NoExpectationExample:
155155
RSpec/StubbedMock:
156156
Exclude:
157157
- 'spec/unit/lib/facter/docker_spec.rb'
158-
159-
# Offense count: 190
160-
# This cop supports safe autocorrection (--autocorrect).
161-
# Configuration parameters: EnforcedStyleForMultiline.
162-
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
163-
Style/TrailingCommaInHashLiteral:
164-
Enabled: false

spec/classes/compose_spec.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@
55
tests = {
66
'with default valus' => {},
77
'with ensure => absent' => {
8-
'ensure' => 'absent',
8+
'ensure' => 'absent'
99
},
1010
'with version => 1.7.0' => {
11-
'version' => '1.7.0',
11+
'version' => '1.7.0'
1212
},
1313
'when proxy is provided' => {
1414
'version' => '1.7.0',
15-
'proxy' => 'http://proxy.example.org:3128/',
15+
'proxy' => 'http://proxy.example.org:3128/'
1616
},
1717
'when proxy is not a http proxy' => {
18-
'proxy' => 'this is not a URL',
18+
'proxy' => 'this is not a URL'
1919
},
2020
'when proxy contains username and password' => {
2121
'version' => '1.7.0',
22-
'proxy' => 'http://user:[email protected]:3128/',
22+
'proxy' => 'http://user:[email protected]:3128/'
2323
},
2424
'when proxy IP is provided' => {
2525
'version' => '1.7.0',
26-
'proxy' => 'http://10.10.10.10:3128/',
26+
'proxy' => 'http://10.10.10.10:3128/'
2727
},
2828
'when base_url is provided' => {
2929
'version' => '1.7.0',
30-
'base_url' => 'http://example.org',
30+
'base_url' => 'http://example.org'
3131
},
3232
'when raw_url is provided' => {
3333
'version' => '1.7.0',
34-
'raw_url' => 'http://example.org',
35-
},
34+
'raw_url' => 'http://example.org'
35+
}
3636
}
3737

3838
describe 'docker::compose', type: :class do
@@ -62,7 +62,7 @@
6262
'proxy' => :undef,
6363
'base_url' => defaults['compose_base_url'],
6464
'raw_url' => :undef,
65-
'curl_ensure' => defaults['curl_ensure'],
65+
'curl_ensure' => defaults['curl_ensure']
6666
}.merge(local_params)
6767

6868
let(:facts) do

spec/classes/images_spec.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
tests = {
66
'with ensure => present' => {
7-
'ensure' => 'present',
7+
'ensure' => 'present'
88
},
99
'with ensure => absent' => {
10-
'ensure' => 'absent',
11-
},
10+
'ensure' => 'absent'
11+
}
1212
}
1313

1414
describe 'docker::images', type: :class do
@@ -38,8 +38,8 @@
3838
'force' => false,
3939
'docker_file' => :undef,
4040
'docker_dir' => :undef,
41-
'docker_tar' => :undef,
42-
},
41+
'docker_tar' => :undef
42+
}
4343
}
4444

4545
params.each do |key, values|
@@ -52,8 +52,8 @@
5252
let(:params) do
5353
{
5454
'images' => {
55-
key => values,
56-
},
55+
key => values
56+
}
5757
}
5858
end
5959

spec/classes/init_spec.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99
'some_random_user',
1010
'foo',
1111
'bar',
12-
],
12+
]
1313
},
1414
'with package_source set to docker-engine' => {
15-
'package_source' => 'docker-engine',
15+
'package_source' => 'docker-engine'
1616
},
1717
'with package_source set to docker-ce' => {
18-
'package_source' => 'docker-ce',
18+
'package_source' => 'docker-ce'
1919
},
2020
'with ensure set to absent' => {
21-
'ensure' => 'absent',
21+
'ensure' => 'absent'
2222
},
2323
'with ensure set to absent and given version' => {
2424
'ensure' => 'absent',
25-
'version' => '16',
25+
'version' => '16'
2626
},
2727
'with ms parameter set' => {
2828
'version' => '16',
2929
'docker_msft_provider_version' => '123',
30-
'nuget_package_provider_version' => '41',
31-
},
30+
'nuget_package_provider_version' => '41'
31+
}
3232
}
3333

3434
describe 'docker', type: :class do
@@ -41,13 +41,13 @@
4141

4242
default_params = {
4343
'docker_ee' => true,
44-
'docker_users' => [],
44+
'docker_users' => []
4545
}
4646
else
4747
facts = os_facts
4848

4949
default_params = {
50-
'docker_users' => [],
50+
'docker_users' => []
5151
}
5252
end
5353

@@ -178,7 +178,7 @@
178178
'tmp_dir_config' => defaults['tmp_dir_config'],
179179
'tmp_dir' => defaults['tmp_dir'],
180180
'use_upstream_package_source' => defaults['use_upstream_package_source'],
181-
'version' => defaults['version'],
181+
'version' => defaults['version']
182182
}.merge(default_params).merge(local_params)
183183

184184
let(:facts) do

spec/classes/machine_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper'
44

55
tests = {
6-
'with default value' => {},
6+
'with default value' => {}
77
}
88

99
describe 'docker::machine', type: :class do
@@ -31,7 +31,7 @@
3131
'install_path' => defaults['machine_install_path'],
3232
'proxy' => :undef,
3333
'url' => :undef,
34-
'curl_ensure' => defaults['curl_ensure'],
34+
'curl_ensure' => defaults['curl_ensure']
3535
}.merge(local_params)
3636

3737
let(:facts) do

spec/classes/networks_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
'driver' => 'overlay',
99
'subnet' => '192.168.1.0/24',
1010
'gateway' => '192.168.1.1',
11-
'ip_range' => '192.168.1.4/32',
11+
'ip_range' => '192.168.1.4/32'
1212
},
1313
'network-absent' => {
1414
'ensure' => 'absent',
1515
'driver' => 'overlay',
1616
'subnet' => '192.168.1.0/24',
1717
'gateway' => '192.168.1.1',
18-
'ip_range' => '192.168.1.4/32',
19-
},
18+
'ip_range' => '192.168.1.4/32'
19+
}
2020
}
2121

2222
describe 'docker::networks', type: :class do
@@ -47,8 +47,8 @@
4747
let(:params) do
4848
{
4949
'networks' => {
50-
title => local_params,
51-
},
50+
title => local_params
51+
}
5252
}
5353
end
5454

spec/classes/plugins_spec.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
tests = {
66
'foo/enabled:latest' => {
7-
'enabled' => true,
7+
'enabled' => true
88
},
99
'foo/disabled:latest' => {
10-
'enabled' => false,
11-
},
10+
'enabled' => false
11+
}
1212
}
1313

1414
describe 'docker::plugins', type: :class do
@@ -40,8 +40,8 @@
4040
'disable_content_trust' => true,
4141
'grant_all_permissions' => true,
4242
'force_remove' => true,
43-
'settings' => [],
44-
},
43+
'settings' => []
44+
}
4545
}
4646

4747
params.each do |key, values|
@@ -54,8 +54,8 @@
5454
let(:params) do
5555
{
5656
'plugins' => {
57-
key => values,
58-
},
57+
key => values
58+
}
5959
}
6060
end
6161

spec/defines/exec_spec.rb

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,42 @@
55
tests = {
66
'with default values' => {},
77
'when running detached' => {
8-
'detach' => true,
8+
'detach' => true
99
},
1010
'when running with tty' => {
11-
'tty' => true,
11+
'tty' => true
1212
},
1313
'when running with interactive' => {
14-
'interactive' => true,
14+
'interactive' => true
1515
},
1616
'when running with onlyif "running"' => {
1717
'interactive' => true,
18-
'onlyif' => 'running',
18+
'onlyif' => 'running'
1919
},
2020
'when running without onlyif custom command' => {
2121
'interactive' => true,
22-
'onlyif' => 'custom',
22+
'onlyif' => 'custom'
2323
},
2424
'when running without onlyif' => {
25-
'interactive' => true,
25+
'interactive' => true
2626
},
2727
'when running with unless' => {
2828
'interactive' => true,
29-
'unless' => 'some_command arg1',
29+
'unless' => 'some_command arg1'
3030
},
3131
'when running without unless' => {
32-
'interactive' => true,
32+
'interactive' => true
3333
},
3434
'with title that need sanitisation' => {
3535
'detach' => true,
36-
'sanitise_name' => true,
36+
'sanitise_name' => true
3737
},
3838
'with environment variables passed to exec' => {
3939
'env' => [
4040
'FOO=BAR',
4141
'FOO2=BAR2',
42-
],
43-
},
42+
]
43+
}
4444
}
4545

4646
describe 'docker::exec', type: :define do
@@ -72,7 +72,7 @@
7272
'refreshonly' => false,
7373
'sanitise_name' => true,
7474
'tty' => false,
75-
'unless' => :undef,
75+
'unless' => :undef
7676
}.merge(local_params)
7777

7878
let(:facts) do

0 commit comments

Comments
 (0)