Skip to content

Commit c3c7931

Browse files
committed
rubocop: autofix
1 parent fdc2dfe commit c3c7931

119 files changed

Lines changed: 1120 additions & 1101 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop_todo.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
---
2-
# Is very common in this module
3-
RSpec/MultipleMemoizedHelpers:
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
3+
# using RuboCop version 1.85.1.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 126
10+
RSpec/LeakyLocalVariable:
411
Enabled: false
12+
13+
# Offense count: 38
14+
# Configuration parameters: AllowSubject.
15+
RSpec/MultipleMemoizedHelpers:
16+
Max: 7
17+
18+
# Offense count: 3
19+
RSpec/SpecFilePathSuffix:
20+
Exclude:
21+
- 'spec/classes/collectd_plugin_ethstat.rb'
22+
- 'spec/classes/collectd_plugin_ipmi.rb'
23+
- 'spec/classes/collectd_plugin_sensors.rb'

spec/classes/collectd_init_spec.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
it do
2323
is_expected.to contain_service('collectd').with(
2424
ensure: 'running',
25-
name: options[:service]
25+
name: options[:service],
2626
)
2727
end
2828

@@ -77,7 +77,7 @@
7777
let(:params) do
7878
{
7979
purge_config: true,
80-
fqdnlookup: false
80+
fqdnlookup: false,
8181
}
8282
end
8383

@@ -88,7 +88,7 @@
8888
let(:params) do
8989
{
9090
purge_config: true,
91-
typesdb: ['/path/to/types.db']
91+
typesdb: ['/path/to/types.db'],
9292
}
9393
end
9494

@@ -99,7 +99,7 @@
9999
let(:params) do
100100
{
101101
purge_config: true,
102-
write_queue_limit_low: 100
102+
write_queue_limit_low: 100,
103103
}
104104
end
105105

@@ -110,7 +110,7 @@
110110
let(:params) do
111111
{
112112
purge_config: true,
113-
write_queue_limit_high: 100
113+
write_queue_limit_high: 100,
114114
}
115115
end
116116

@@ -121,7 +121,7 @@
121121
let(:params) do
122122
{
123123
purge_config: true,
124-
include: ['/some/include/path']
124+
include: ['/some/include/path'],
125125
}
126126
end
127127

@@ -132,7 +132,7 @@
132132
let(:params) do
133133
{
134134
purge_config: true,
135-
has_wordexp: false
135+
has_wordexp: false,
136136
}
137137
end
138138

@@ -144,7 +144,7 @@
144144
let(:params) do
145145
{
146146
purge_config: true,
147-
has_wordexp: true
147+
has_wordexp: true,
148148
}
149149
end
150150

@@ -160,7 +160,7 @@
160160
let(:params) do
161161
{
162162
purge_config: true,
163-
internal_stats: true
163+
internal_stats: true,
164164
}
165165
end
166166

@@ -174,7 +174,7 @@
174174
let(:params) do
175175
{
176176
purge_config: true,
177-
internal_stats: true
177+
internal_stats: true,
178178
}
179179
end
180180

@@ -217,7 +217,7 @@
217217
let(:params) do
218218
{
219219
manage_repo: true,
220-
manage_package: true
220+
manage_package: true,
221221
}
222222
end
223223

@@ -228,7 +228,7 @@
228228
let(:params) do
229229
{
230230
manage_repo: true,
231-
manage_package: false
231+
manage_package: false,
232232
}
233233
end
234234

@@ -240,20 +240,20 @@
240240
let(:params) do
241241
{
242242
manage_repo: true,
243-
ci_package_repo: '5.6'
243+
ci_package_repo: '5.6',
244244
}
245245
end
246246

247247
it { is_expected.to contain_yumrepo('collectd-ci').with_gpgkey('https://pkg.ci.collectd.org/pubkey.asc').with_baseurl("https://pkg.ci.collectd.org/rpm/collectd-5.6/epel-#{facts[:operatingsystemmajrelease]}-x86_64") } if facts[:osfamily] == 'RedHat'
248248
if facts[:osfamily] == 'Debian'
249249
it do
250-
is_expected.to contain_apt__source('collectd-ci').
251-
with_location('https://pkg.ci.collectd.org/deb/').
252-
with_key(
250+
is_expected.to contain_apt__source('collectd-ci')
251+
.with_location('https://pkg.ci.collectd.org/deb/')
252+
.with_key(
253253
'id' => 'F806817DC3F5EA417F9FA2963994D24FB8543576',
254-
'server' => 'keyserver.ubuntu.com'
255-
).
256-
with_repos('collectd-5.6')
254+
'server' => 'keyserver.ubuntu.com',
255+
)
256+
.with_repos('collectd-5.6')
257257
end
258258
end
259259
end
@@ -263,20 +263,20 @@
263263
{
264264
manage_repo: true,
265265
ci_package_repo: '5.6',
266-
package_keyserver: 'pgp.mit.edu'
266+
package_keyserver: 'pgp.mit.edu',
267267
}
268268
end
269269

270270
it { is_expected.to contain_yumrepo('collectd-ci').with_gpgkey('https://pkg.ci.collectd.org/pubkey.asc').with_baseurl("https://pkg.ci.collectd.org/rpm/collectd-5.6/epel-#{facts[:operatingsystemmajrelease]}-x86_64") } if facts[:osfamily] == 'RedHat'
271271
if facts[:osfamily] == 'Debian'
272272
it do
273-
is_expected.to contain_apt__source('collectd-ci').
274-
with_location('https://pkg.ci.collectd.org/deb/').
275-
with_key(
273+
is_expected.to contain_apt__source('collectd-ci')
274+
.with_location('https://pkg.ci.collectd.org/deb/')
275+
.with_key(
276276
'id' => 'F806817DC3F5EA417F9FA2963994D24FB8543576',
277-
'server' => 'pgp.mit.edu'
278-
).
279-
with_repos('collectd-5.6')
277+
'server' => 'pgp.mit.edu',
278+
)
279+
.with_repos('collectd-5.6')
280280
end
281281
end
282282
end

spec/classes/collectd_plugin_amqp1_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
it { is_expected.to contain_file('old_amqp1.load').with_ensure('absent') }
2525
it { is_expected.to contain_file('older_amqp1.load').with_ensure('absent') }
2626

27-
it 'Will create 10-amqp1.conf' do
27+
it 'creates 10-amqp1.conf' do
2828
is_expected.to contain_file('amqp1.load').with(
2929
ensure: 'present',
30-
path: "#{options[:plugin_conf_dir]}/10-amqp1.conf"
30+
path: "#{options[:plugin_conf_dir]}/10-amqp1.conf",
3131
)
3232
end
3333

@@ -61,9 +61,9 @@
6161
graphite_escape_char: '_',
6262
graphite_separate_instances: false,
6363
graphite_always_append_ds: false,
64-
graphite_preserve_separator: false
65-
}
66-
} }
64+
graphite_preserve_separator: false,
65+
},
66+
}, }
6767
end
6868

6969
it { is_expected.to contain_file('amqp1.load').with(content: %r{<Transport "transport">}) }
@@ -92,10 +92,10 @@
9292
{ ensure: 'absent' }
9393
end
9494

95-
it 'Will not create 10-amqp1.conf' do
95+
it 'does not create 10-amqp1.conf' do
9696
is_expected.to contain_file('amqp1.load').with(
9797
ensure: 'absent',
98-
path: "#{options[:plugin_conf_dir]}/10-amqp1.conf"
98+
path: "#{options[:plugin_conf_dir]}/10-amqp1.conf",
9999
)
100100
end
101101
end

spec/classes/collectd_plugin_amqp_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
it { is_expected.to contain_file('old_amqp.load').with_ensure('absent') }
2424
it { is_expected.to contain_file('older_amqp.load').with_ensure('absent') }
2525

26-
it 'Will create 10-amqp.conf' do
26+
it 'creates 10-amqp.conf' do
2727
is_expected.to contain_file('amqp.load').with(
2828
ensure: 'present',
29-
path: "#{options[:plugin_conf_dir]}/10-amqp.conf"
29+
path: "#{options[:plugin_conf_dir]}/10-amqp.conf",
3030
)
3131
end
3232

@@ -59,7 +59,7 @@
5959
graphiteprefix: 'prefix',
6060
escapecharacter: '|',
6161
graphiteseparateinstances: true,
62-
graphitealwaysappendds: true }
62+
graphitealwaysappendds: true, }
6363
end
6464

6565
it { is_expected.to contain_file('amqp.load').with(content: %r{<Publish "graphite">}) }
@@ -91,10 +91,10 @@
9191
{ ensure: 'absent' }
9292
end
9393

94-
it 'Will not create 10-amqp.conf' do
94+
it 'does not create 10-amqp.conf' do
9595
is_expected.to contain_file('amqp.load').with(
9696
ensure: 'absent',
97-
path: "#{options[:plugin_conf_dir]}/10-amqp.conf"
97+
path: "#{options[:plugin_conf_dir]}/10-amqp.conf",
9898
)
9999
end
100100
end

spec/classes/collectd_plugin_apache_instance_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'verifyhost' => true,
2525
'cacert' => '/etc/foobar/ca.crt',
2626
'sslciphers' => 'TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256',
27-
'timeout' => 120
27+
'timeout' => 120,
2828
}
2929
end
3030

@@ -48,7 +48,7 @@
4848
is_expected.to contain_class('collectd::plugin::apache')
4949
is_expected.to contain_file('apache-instance-site2.conf').with(
5050
content: content_instance_file,
51-
path: "#{options[:plugin_conf_dir]}/25-apache-instance-site2.conf"
51+
path: "#{options[:plugin_conf_dir]}/25-apache-instance-site2.conf",
5252
)
5353
end
5454
end

spec/classes/collectd_plugin_apache_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
is_expected.to compile.with_all_deps
3434
is_expected.to contain_file('apache.load').with(
3535
content: content,
36-
path: "#{options[:plugin_conf_dir]}/10-apache.conf"
36+
path: "#{options[:plugin_conf_dir]}/10-apache.conf",
3737
)
3838
end
3939
end
@@ -49,7 +49,7 @@
4949
'password' => 'hidden',
5050
'verifypeer' => true,
5151
'verifyhost' => false,
52-
'cacert' => '/etc/barfoo/ca.crt'
52+
'cacert' => '/etc/barfoo/ca.crt',
5353
},
5454
site2: {
5555
'url' => 'https://another.example.com',
@@ -59,9 +59,9 @@
5959
'verifyhost' => true,
6060
'cacert' => '/etc/foobar/ca.crt',
6161
'sslciphers' => 'TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256',
62-
'timeout' => 120
63-
}
64-
}
62+
'timeout' => 120,
63+
},
64+
},
6565
}
6666
end
6767

@@ -98,7 +98,7 @@
9898
is_expected.to compile.with_all_deps
9999
is_expected.to contain_file('apache.load').with(
100100
content: content,
101-
path: "#{options[:plugin_conf_dir]}/10-apache.conf"
101+
path: "#{options[:plugin_conf_dir]}/10-apache.conf",
102102
)
103103
end
104104
end
@@ -108,11 +108,11 @@
108108
context ':manage_package => true on osfamily => RedHat' do
109109
let :params do
110110
{
111-
manage_package: true
111+
manage_package: true,
112112
}
113113
end
114114

115-
it 'Will manage collectd-apache' do
115+
it 'manages collectd-apache' do
116116
is_expected.to compile.with_all_deps
117117
is_expected.to contain_package('collectd-apache').with(ensure: 'present',
118118
name: 'collectd-apache')
@@ -124,11 +124,11 @@
124124
context ':manage_package => false on osfamily => RedHat' do
125125
let :params do
126126
{
127-
manage_package: false
127+
manage_package: false,
128128
}
129129
end
130130

131-
it 'Will not manage collectd-apache' do
131+
it 'does not manage collectd-apache' do
132132
is_expected.to compile.with_all_deps
133133
is_expected.not_to contain_package('collectd-apache').with(ensure: 'present',
134134
name: 'collectd-apache')

spec/classes/collectd_plugin_battery_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
is_expected.to compile.with_all_deps
3030
is_expected.to contain_file('battery.load').with(
3131
content: content,
32-
path: "#{options[:plugin_conf_dir]}/10-battery.conf"
32+
path: "#{options[:plugin_conf_dir]}/10-battery.conf",
3333
)
3434
end
3535
end
@@ -40,7 +40,7 @@
4040
{
4141
'values_percentage' => true,
4242
'report_degraded' => true,
43-
'query_state_fs' => true
43+
'query_state_fs' => true,
4444
}
4545
end
4646

@@ -63,7 +63,7 @@
6363
is_expected.to contain_class('collectd')
6464
is_expected.to contain_file('battery.load').with(
6565
content: content,
66-
path: "#{options[:plugin_conf_dir]}/10-battery.conf"
66+
path: "#{options[:plugin_conf_dir]}/10-battery.conf",
6767
)
6868
end
6969
end

0 commit comments

Comments
 (0)