Skip to content

Commit 7fa0edc

Browse files
(CAT-2385) Fix rubocop offenses
1 parent fae47e0 commit 7fa0edc

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

lib/puppet/functions/postgresql/postgresql_password.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def pg_sha256(password, salt)
6565
def digest_key(password, salt)
6666
OpenSSL::KDF.pbkdf2_hmac(
6767
password,
68-
salt: salt,
68+
salt:,
6969
iterations: 4096,
7070
length: 32,
7171
hash: OpenSSL::Digest.new('SHA256'),

lib/puppet/provider/postgresql_conf/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def parse_config
2929
else
3030
matches[:value].delete("'")
3131
end
32-
attributes_hash = { line_number: line_number, key: matches[:key], ensure: 'present', value: value, comment: matches[:comment] }
32+
attributes_hash = { line_number:, key: matches[:key], ensure: 'present', value:, comment: matches[:comment] }
3333
active_settings.push(attributes_hash)
3434
end
3535
end

lib/puppet/provider/postgresql_replication_slot/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def self.instances
88
run_sql_command('SELECT * FROM pg_replication_slots;')[0].split("\n").select { |l| l.include?('|') }.map do |l|
99
name, *_others = l.strip.split(%r{\s+\|\s+})
10-
new(name: name,
10+
new(name:,
1111
ensure: :present)
1212
end
1313
end

spec/defines/server/pg_hba_rule_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class { 'postgresql::server': }
2525
user: 'all',
2626
address: '1.1.1.1/24',
2727
auth_method: 'md5',
28-
target: target
28+
target:
2929
}
3030
end
3131

@@ -47,7 +47,7 @@ class { 'postgresql::server': }
4747
database: 'all',
4848
user: 'all',
4949
auth_method: 'ident',
50-
target: target
50+
target:
5151
}
5252
end
5353

@@ -71,7 +71,7 @@ class { 'postgresql::server': }
7171
address: '0.0.0.0/0',
7272
auth_method: 'ldap',
7373
auth_option: 'foo=bar',
74-
target: target
74+
target:
7575
}
7676
end
7777

@@ -98,7 +98,7 @@ class { 'postgresql::server': }
9898
user: 'all',
9999
address: '0.0.0.0/0',
100100
auth_method: 'peer',
101-
target: target
101+
target:
102102
}
103103
end
104104

@@ -126,7 +126,7 @@ class { 'postgresql::server': }
126126
user: 'all',
127127
address: '0.0.0.0/0',
128128
auth_method: 'scram-sha-256',
129-
target: target
129+
target:
130130
}
131131
end
132132

@@ -240,7 +240,7 @@ class { 'postgresql::server': }
240240
user: 'all',
241241
address: '.domain.tld',
242242
auth_method: 'md5',
243-
target: target
243+
target:
244244
}
245245
end
246246

@@ -263,7 +263,7 @@ class { 'postgresql::server': }
263263
user: 'all',
264264
address: '/45',
265265
auth_method: 'md5',
266-
target: target
266+
target:
267267
}
268268
end
269269

spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe Puppet::Type.type(:postgresql_psql).provider(:ruby) do
66
let(:name) { 'rspec psql test' }
77
let(:resource) do
8-
Puppet::Type.type(:postgresql_psql).new({ name: name, provider: :ruby }.merge(attributes))
8+
Puppet::Type.type(:postgresql_psql).new({ name:, provider: :ruby }.merge(attributes))
99
end
1010
let(:provider) { resource.provider }
1111

spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def success?
2020

2121
let(:name) { 'standby' }
2222
let(:resource) do
23-
type.new({ name: name, provider: :ruby }.merge(attributes))
23+
type.new({ name:, provider: :ruby }.merge(attributes))
2424
end
2525
let(:sql_instances) do
2626
"abc | | physical | | | t | | | 0/3000420

spec/unit/puppet/type/postgresql_psql_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
[true, :true].each do |refreshonly|
133133
context "refreshonly => #{refreshonly.inspect}" do
134134
let(:attributes) do
135-
{ refreshonly: refreshonly }
135+
{ refreshonly: }
136136
end
137137

138138
context 'not refreshing'
@@ -141,7 +141,7 @@
141141

142142
context "refreshonly => #{refreshonly.inspect}" do
143143
let(:attributes) do
144-
{ refreshonly: refreshonly }
144+
{ refreshonly: }
145145
end
146146

147147
context 'refreshing'
@@ -152,7 +152,7 @@
152152
[false, :false].each do |refreshonly|
153153
context "refreshonly => #{refreshonly.inspect}" do
154154
let(:attributes) do
155-
{ refreshonly: refreshonly }
155+
{ refreshonly: }
156156
end
157157

158158
context 'not refreshing'
@@ -161,7 +161,7 @@
161161

162162
context "refreshonly => #{refreshonly.inspect}" do
163163
let(:attributes) do
164-
{ refreshonly: refreshonly }
164+
{ refreshonly: }
165165
end
166166

167167
context 'refreshing'
@@ -176,7 +176,7 @@
176176
[true, :true].each do |refreshonly|
177177
context "refreshonly => #{refreshonly.inspect}" do
178178
let(:attributes) do
179-
{ refreshonly: refreshonly, unless: 'SELECT something' }
179+
{ refreshonly:, unless: 'SELECT something' }
180180
end
181181

182182
context 'not refreshing'
@@ -185,7 +185,7 @@
185185

186186
context "refreshonly => #{refreshonly.inspect}" do
187187
let(:attributes) do
188-
{ refreshonly: refreshonly, unless: 'SELECT something' }
188+
{ refreshonly:, unless: 'SELECT something' }
189189
end
190190

191191
context 'refreshing'
@@ -196,7 +196,7 @@
196196
[false, :false].each do |refreshonly|
197197
context "refreshonly => #{refreshonly.inspect}" do
198198
let(:attributes) do
199-
{ refreshonly: refreshonly, unless: 'SELECT something' }
199+
{ refreshonly:, unless: 'SELECT something' }
200200
end
201201

202202
context 'not refreshing'
@@ -205,7 +205,7 @@
205205

206206
context "refreshonly => #{refreshonly.inspect}" do
207207
let(:attributes) do
208-
{ refreshonly: refreshonly, unless: 'SELECT something' }
208+
{ refreshonly:, unless: 'SELECT something' }
209209
end
210210

211211
context 'refreshing'
@@ -220,7 +220,7 @@
220220
[true, :true].each do |refreshonly|
221221
context "refreshonly => #{refreshonly.inspect}" do
222222
let(:attributes) do
223-
{ refreshonly: refreshonly, unless: 'SELECT something' }
223+
{ refreshonly:, unless: 'SELECT something' }
224224
end
225225

226226
context 'not refreshing'
@@ -229,7 +229,7 @@
229229

230230
context "refreshonly => #{refreshonly.inspect}" do
231231
let(:attributes) do
232-
{ refreshonly: refreshonly, unless: 'SELECT something' }
232+
{ refreshonly:, unless: 'SELECT something' }
233233
end
234234

235235
context 'refreshing'
@@ -240,7 +240,7 @@
240240
[false, :false].each do |refreshonly|
241241
context "refreshonly => #{refreshonly.inspect}" do
242242
let(:attributes) do
243-
{ refreshonly: refreshonly, unless: 'SELECT something' }
243+
{ refreshonly:, unless: 'SELECT something' }
244244
end
245245

246246
context 'not refreshing'
@@ -249,7 +249,7 @@
249249

250250
context "refreshonly => #{refreshonly.inspect}" do
251251
let(:attributes) do
252-
{ refreshonly: refreshonly, unless: 'SELECT something' }
252+
{ refreshonly:, unless: 'SELECT something' }
253253
end
254254

255255
context 'refreshing'

0 commit comments

Comments
 (0)