Skip to content

Commit 3cff22c

Browse files
committed
(CONT-773) Rubocop Auto Fixes 16-17
- Style/RescueStandardError - Style/TrailingCommaInHashLiteral
1 parent 4513a58 commit 3cff22c

File tree

16 files changed

+339
-369
lines changed

16 files changed

+339
-369
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -167,38 +167,8 @@ Style/MixinUsage:
167167
Exclude:
168168
- 'spec/spec_helper.rb'
169169

170-
# Offense count: 1
171-
# This cop supports safe autocorrection (--autocorrect).
172-
# Configuration parameters: EnforcedStyle.
173-
# SupportedStyles: implicit, explicit
174-
Style/RescueStandardError:
175-
Exclude:
176-
- 'spec/spec_helper.rb'
177-
178170
# Offense count: 2
179171
# This cop supports unsafe autocorrection (--autocorrect-all).
180172
Style/SlicingWithRange:
181173
Exclude:
182174
- 'lib/puppet/provider/apt_key/apt_key.rb'
183-
184-
# Offense count: 338
185-
# This cop supports safe autocorrection (--autocorrect).
186-
# Configuration parameters: EnforcedStyleForMultiline.
187-
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
188-
Style/TrailingCommaInHashLiteral:
189-
Exclude:
190-
- 'lib/puppet/provider/apt_key/apt_key.rb'
191-
- 'spec/classes/apt_backports_spec.rb'
192-
- 'spec/classes/apt_spec.rb'
193-
- 'spec/classes/apt_update_spec.rb'
194-
- 'spec/defines/conf_spec.rb'
195-
- 'spec/defines/key_compat_spec.rb'
196-
- 'spec/defines/key_spec.rb'
197-
- 'spec/defines/mark_spec.rb'
198-
- 'spec/defines/pin_spec.rb'
199-
- 'spec/defines/ppa_spec.rb'
200-
- 'spec/defines/setting_spec.rb'
201-
- 'spec/defines/source_compat_spec.rb'
202-
- 'spec/defines/source_spec.rb'
203-
- 'spec/spec_helper.rb'
204-
- 'spec/unit/puppet/provider/apt_key_spec.rb'

lib/puppet/provider/apt_key/apt_key.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def self.key_line_hash(pub_line, fpr_line)
9696
key_size: pub_split[2],
9797
key_type: nil,
9898
key_created: Time.at(pub_split[5].to_i),
99-
key_expiry: pub_split[6].empty? ? nil : Time.at(pub_split[6].to_i),
99+
key_expiry: pub_split[6].empty? ? nil : Time.at(pub_split[6].to_i)
100100
}
101101

102102
# set key type based on types defined in /usr/share/doc/gnupg/DETAILS.gz

spec/classes/apt_backports_spec.rb

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
name: 'Debian',
1515
release: {
1616
major: '9',
17-
full: '9.0',
17+
full: '9.0'
1818
},
1919
distro: {
2020
codename: 'stretch',
21-
id: 'Debian',
22-
},
23-
},
21+
id: 'Debian'
22+
}
23+
}
2424
}
2525
end
2626

@@ -40,13 +40,13 @@
4040
name: 'Ubuntu',
4141
release: {
4242
major: '18',
43-
full: '18.04',
43+
full: '18.04'
4444
},
4545
distro: {
4646
codename: 'bionac',
47-
id: 'Ubuntu',
48-
},
49-
},
47+
id: 'Ubuntu'
48+
}
49+
}
5050
}
5151
end
5252

@@ -67,13 +67,13 @@
6767
name: 'Ubuntu',
6868
release: {
6969
major: '18',
70-
full: '18.04',
70+
full: '18.04'
7171
},
7272
distro: {
7373
codename: 'bionac',
74-
id: 'Ubuntu',
75-
},
76-
},
74+
id: 'Ubuntu'
75+
}
76+
}
7777
}
7878
end
7979
let(:params) do
@@ -82,7 +82,7 @@
8282
release: 'vivid',
8383
repos: 'main',
8484
key: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
85-
pin: '90',
85+
pin: '90'
8686
}
8787
end
8888

@@ -103,23 +103,23 @@
103103
name: 'Ubuntu',
104104
release: {
105105
major: '18',
106-
full: '18.04',
106+
full: '18.04'
107107
},
108108
distro: {
109109
codename: 'bionac',
110-
id: 'Ubuntu',
111-
},
112-
},
110+
id: 'Ubuntu'
111+
}
112+
}
113113
}
114114
end
115115
let(:params) do
116116
{
117117
key: {
118-
'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
118+
'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553'
119119
},
120120
pin: {
121-
'priority' => '90',
122-
},
121+
'priority' => '90'
122+
}
123123
}
124124
end
125125

@@ -138,13 +138,13 @@
138138
name: 'LinuxMint',
139139
release: {
140140
major: '17',
141-
full: '17',
141+
full: '17'
142142
},
143143
distro: {
144144
codename: 'qiana',
145-
id: 'LinuxMint',
146-
},
147-
},
145+
id: 'LinuxMint'
146+
}
147+
}
148148
}
149149
end
150150

@@ -154,7 +154,7 @@
154154
location: 'http://archive.ubuntu.com/ubuntu',
155155
release: 'trusty-backports',
156156
repos: 'main universe multiverse restricted',
157-
key: '630239CC130E1A7FD81A27B140976EAF437D05B5',
157+
key: '630239CC130E1A7FD81A27B140976EAF437D05B5'
158158
}
159159
end
160160

@@ -172,7 +172,7 @@
172172
{
173173
release: 'trusty-backports',
174174
repos: 'main universe multiverse restricted',
175-
key: '630239CC130E1A7FD81A27B140976EAF437D05B5',
175+
key: '630239CC130E1A7FD81A27B140976EAF437D05B5'
176176
}
177177
end
178178

@@ -186,7 +186,7 @@
186186
{
187187
location: 'http://archive.ubuntu.com/ubuntu',
188188
repos: 'main universe multiverse restricted',
189-
key: '630239CC130E1A7FD81A27B140976EAF437D05B5',
189+
key: '630239CC130E1A7FD81A27B140976EAF437D05B5'
190190
}
191191
end
192192

@@ -200,7 +200,7 @@
200200
{
201201
location: 'http://archive.ubuntu.com/ubuntu',
202202
release: 'trusty-backports',
203-
key: '630239CC130E1A7FD81A27B140976EAF437D05B5',
203+
key: '630239CC130E1A7FD81A27B140976EAF437D05B5'
204204
}
205205
end
206206

@@ -214,7 +214,7 @@
214214
{
215215
location: 'http://archive.ubuntu.com/ubuntu',
216216
release: 'trusty-backports',
217-
repos: 'main universe multiverse restricted',
217+
repos: 'main universe multiverse restricted'
218218
}
219219
end
220220

@@ -232,20 +232,20 @@
232232
name: 'Ubuntu',
233233
release: {
234234
major: '18',
235-
full: '18.04',
235+
full: '18.04'
236236
},
237237
distro: {
238238
codename: 'bionac',
239-
id: 'Ubuntu',
240-
},
241-
},
239+
id: 'Ubuntu'
240+
}
241+
}
242242
}
243243
end
244244

245245
context 'with invalid location' do
246246
let(:params) do
247247
{
248-
location: true,
248+
location: true
249249
}
250250
end
251251

@@ -257,7 +257,7 @@
257257
context 'with invalid release' do
258258
let(:params) do
259259
{
260-
release: true,
260+
release: true
261261
}
262262
end
263263

@@ -269,7 +269,7 @@
269269
context 'with invalid repos' do
270270
let(:params) do
271271
{
272-
repos: true,
272+
repos: true
273273
}
274274
end
275275

@@ -281,7 +281,7 @@
281281
context 'with invalid key' do
282282
let(:params) do
283283
{
284-
key: true,
284+
key: true
285285
}
286286
end
287287

@@ -293,7 +293,7 @@
293293
context 'with invalid pin' do
294294
let(:params) do
295295
{
296-
pin: true,
296+
pin: true
297297
}
298298
end
299299

0 commit comments

Comments
 (0)