Skip to content

Commit 4a66671

Browse files
committed
Correct Style/TrailingCommaInHashLiteral
1 parent 9d6af82 commit 4a66671

File tree

4 files changed

+50
-60
lines changed

4 files changed

+50
-60
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,3 @@ RSpec/NestedGroups:
7777
Style/MixinUsage:
7878
Exclude:
7979
- 'spec/spec_helper.rb'
80-
81-
# Offense count: 50
82-
# This cop supports safe autocorrection (--autocorrect).
83-
# Configuration parameters: EnforcedStyleForMultiline.
84-
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
85-
Style/TrailingCommaInHashLiteral:
86-
Exclude:
87-
- 'spec/acceptance/accounts_spec.rb'
88-
- 'spec/defines/accounts_user_spec.rb'
89-
- 'spec/spec_helper.rb'

spec/acceptance/accounts_spec.rb

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,27 @@
1111

1212
hd_defaults = {
1313
'accounts::user_defaults' => {
14-
'home_mode' => '0700',
15-
},
14+
'home_mode' => '0700'
15+
}
1616
}
1717

1818
hd_group = {
1919
'accounts::group_defaults' => {
2020
'ensure' => 'present',
21-
'system' => true,
21+
'system' => true
2222
},
2323
'accounts::group_list' => {
2424
'staff' => {
25-
'gid' => 1234,
26-
},
27-
},
25+
'gid' => 1234
26+
}
27+
}
2828
}
2929

3030
hd_group_change = hd_group.merge(
3131
'accounts::group_list' => {
3232
'staff' => {
33-
'gid' => 1235,
34-
},
33+
'gid' => 1235
34+
}
3535
},
3636
)
3737

@@ -50,8 +50,8 @@
5050
"ssh-rsa #{test_key} vagrant",
5151
'command="/bin/echo Hello",from="myhost.exapmle.com,192.168.1.1" ' \
5252
"ssh-rsa #{test_key} vagrant2",
53-
],
54-
},
53+
]
54+
}
5555
},
5656
)
5757

@@ -73,8 +73,8 @@
7373
"ssh-rsa #{test_key} vagrant",
7474
'command="/bin/echo Hello",from="myhost.exapmle.com,192.168.1.1" ' \
7575
"ssh-rsa #{test_key} vagrant2",
76-
],
77-
},
76+
]
77+
}
7878
},
7979
)
8080

@@ -84,8 +84,8 @@
8484
'managehome' => false,
8585
'sshkeys' => [
8686
"ssh-rsa #{test_key} vagrant",
87-
],
88-
},
87+
]
88+
}
8989
},
9090
)
9191

@@ -104,16 +104,16 @@
104104
"ssh-rsa #{test_key} vagrant",
105105
'from="myhost.example.com,192.168.1.1" ' \
106106
"ssh-rsa #{test_key} vagrant2",
107-
],
108-
},
107+
]
108+
}
109109
},
110110
)
111111

112112
hd_locked_user = hd_defaults.merge(
113113
'accounts::user_list' => {
114114
'hunner' => {
115-
'locked' => true,
116-
},
115+
'locked' => true
116+
}
117117
},
118118
)
119119

@@ -122,8 +122,8 @@
122122
'first.last' => {
123123
'group' => 'staff',
124124
'password' => '!!',
125-
'home' => '/test/first.last',
126-
},
125+
'home' => '/test/first.last'
126+
}
127127
},
128128
)
129129

@@ -132,8 +132,8 @@
132132
'grp_flse' => {
133133
'group' => 'newgrp_1',
134134
'create_group' => false,
135-
'home' => '/test/grp_flse',
136-
},
135+
'home' => '/test/grp_flse'
136+
}
137137
},
138138
)
139139

@@ -142,17 +142,17 @@
142142
'grp_true' => {
143143
'group' => 'newgrp_2',
144144
'create_group' => true,
145-
'home' => '/test/grp_true',
146-
},
145+
'home' => '/test/grp_true'
146+
}
147147
},
148148
)
149149

150150
hd_ignore_user_first_run = hd_defaults.merge(
151151
'accounts::user_list' => {
152152
'ignore_user' => {
153153
'group' => 'staff',
154-
'password' => 'foo',
155-
},
154+
'password' => 'foo'
155+
}
156156
},
157157
)
158158

@@ -161,17 +161,17 @@
161161
'ignore_user' => {
162162
'group' => 'staff',
163163
'password' => '',
164-
'ignore_password_if_empty' => true,
165-
},
164+
'ignore_password_if_empty' => true
165+
}
166166
},
167167
)
168168

169169
hd_no_ignore_user_first_run = hd_defaults.merge(
170170
'accounts::user_list' => {
171171
'no_ignore_user' => {
172172
'group' => 'staff',
173-
'password' => 'foo',
174-
},
173+
'password' => 'foo'
174+
}
175175
},
176176
)
177177

@@ -180,17 +180,17 @@
180180
'no_ignore_user' => {
181181
'group' => 'staff',
182182
'password' => '',
183-
'ignore_password_if_empty' => false,
184-
},
183+
'ignore_password_if_empty' => false
184+
}
185185
},
186186
)
187187

188188
hd_specd_user_first_run = hd_defaults.merge(
189189
'accounts::user_list' => {
190190
'specd_user' => {
191191
'group' => 'staff',
192-
'password' => 'foo',
193-
},
192+
'password' => 'foo'
193+
}
194194
},
195195
)
196196

@@ -199,8 +199,8 @@
199199
'specd_user' => {
200200
'group' => 'staff',
201201
'password' => 'bar',
202-
'ignore_password_if_empty' => true,
203-
},
202+
'ignore_password_if_empty' => true
203+
}
204204
},
205205
)
206206

@@ -209,29 +209,29 @@
209209
'duplicate_user1' => {
210210
'allowdupe' => true,
211211
'uid' => '1234',
212-
'sshkey_owner' => 'duplicate_user1',
212+
'sshkey_owner' => 'duplicate_user1'
213213
},
214214
'duplicate_user2' => {
215215
'allowdupe' => true,
216216
'uid' => 1234,
217-
'sshkey_owner' => 'duplicate_user1',
218-
},
217+
'sshkey_owner' => 'duplicate_user1'
218+
}
219219
},
220220
)
221221

222222
hd_delete_accounts = {
223223
'accounts::group_defaults' => {
224-
'ensure' => 'absent',
224+
'ensure' => 'absent'
225225
},
226226
'accounts::group_list' => {
227227
'newgrp_1' => {},
228228
'newgrp_2' => {},
229-
'staff' => {},
229+
'staff' => {}
230230
},
231231
'accounts::user_defaults' => {
232232
'ensure' => 'absent',
233233
'create_group' => true,
234-
'purge_user_home' => true,
234+
'purge_user_home' => true
235235
},
236236
'accounts::user_list' => {
237237
'hunner' => {
@@ -242,23 +242,23 @@
242242
'sshkeys' => [
243243
"ssh-rsa #{test_key} vagrant",
244244
"ssh-rsa #{test_key} vagrant2",
245-
],
245+
]
246246
},
247247
'first.last' => {
248-
'home' => '/test/first.last',
248+
'home' => '/test/first.last'
249249
},
250250
'grp_flse' => {
251-
'home' => '/test/grp_flse',
251+
'home' => '/test/grp_flse'
252252
},
253253
'grp_true' => {
254-
'home' => '/test/grp_true',
254+
'home' => '/test/grp_true'
255255
},
256256
'ignore_user' => {},
257257
'no_ignore_user' => {},
258258
'specd_user' => {},
259259
'duplicate_user1' => {},
260-
'duplicate_user2' => {},
261-
},
260+
'duplicate_user2' => {}
261+
}
262262
}
263263

264264
pp_manifest = <<-PUPPETCODE

spec/defines/accounts_user_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
sshkeys: ['ssh-rsa AAAAB3Nza...LiPk== [email protected]',
6767
'permitopen="192.0.2.1:80",permitopen="192.0.2.2:25" ssh-dss AAAAB5...21S== dan key2',
6868
'command="/bin/echo Hello World",from="myhost.exapmle.com,192.168.1.1" ecdsa-sha2-nistp521 test_key vagrant2'],
69-
uid: 123,
69+
uid: 123
7070
}
7171
end
7272

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
default_facts = {
1515
puppetversion: Puppet.version,
16-
facterversion: Facter.version,
16+
facterversion: Facter.version
1717
}
1818

1919
default_fact_files = [

0 commit comments

Comments
 (0)