Skip to content

Commit 02305d0

Browse files
author
jordanbreen28
committed
(CONT-792) - Correct Layout/ClosingHeredocIndentation
1 parent 8fa354c commit 02305d0

File tree

7 files changed

+16
-34
lines changed

7 files changed

+16
-34
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2023-04-19 13:27:54 UTC using RuboCop version 1.48.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: 11
10-
# This cop supports safe autocorrection (--autocorrect).
11-
Layout/ClosingHeredocIndentation:
12-
Exclude:
13-
- 'lib/puppet/type/postgresql_replication_slot.rb'
14-
- 'spec/acceptance/alternative_port_spec.rb'
15-
- 'spec/acceptance/overridden_settings_spec.rb'
16-
- 'spec/acceptance/server/grant_spec.rb'
17-
- 'spec/acceptance/utf8_encoding_spec.rb'
18-
191
# Offense count: 6
202
# This cop supports safe autocorrection (--autocorrect).
213
Layout/EmptyLineAfterGuardClause:

lib/puppet/type/postgresql_psql.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def retrieve
2323

2424
def sync
2525
output, status = provider.run_sql_command(value)
26-
raise("Error executing SQL; psql returned #{status}: '#{output}'") unless status == 0
26+
raise("Error executing SQL; psql returned #{status}: '#{output}'") unless status.zero?
2727
end
2828
end
2929

@@ -38,12 +38,12 @@ def sync
3838
# Return true if a matching row is found
3939
def matches(value)
4040
output, status = provider.run_unless_sql_command(value)
41-
fail("Error evaluating 'unless' clause, returned #{status}: '#{output}'") unless status == 0 # rubocop:disable Style/SignalException
41+
fail("Error evaluating 'unless' clause, returned #{status}: '#{output}'") unless status.zero? # rubocop:disable Style/SignalException
4242
# rubocop:enable Style/NumericPredicate
4343

4444
result_count = output.strip.to_i
4545
debug("Found #{result_count} row(s) executing 'unless' clause")
46-
result_count > 0
46+
result_count.positive?
4747
end
4848
end
4949

@@ -60,10 +60,10 @@ def matches(value)
6060
output, status = provider.run_unless_sql_command(value)
6161
status = output.exitcode if status.nil?
6262

63-
raise("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status == 0
63+
raise("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status.zero?
6464
result_count = output.strip.to_i
6565
debug("Found #{result_count} row(s) executing 'onlyif' clause")
66-
result_count > 0
66+
result_count.positive?
6767
end
6868
end
6969

lib/puppet/type/postgresql_replication_slot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This type allows to create and destroy replication slots
88
to register warm standby replication on a Postgresql
99
primary server.
10-
EOS
10+
EOS
1111

1212
ensurable
1313

spec/acceptance/alternative_port_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
it 'on an alternative port' do
99
pp = <<-MANIFEST
1010
class { 'postgresql::server': port => '55433', manage_selinux => true }
11-
MANIFEST
11+
MANIFEST
1212
if os[:family] == 'redhat' && os[:release].start_with?('8')
1313
apply_manifest(pp, expect_failures: false)
1414
# GCP failures on redhat8 IAC-1286 - idempotency failing

spec/acceptance/overridden_settings_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class { 'postgresql::server':
3131
postgresql::server::database { 'testusername':
3232
owner => 'testusername',
3333
}
34-
MANIFEST
34+
MANIFEST
3535
end
3636

3737
it 'with additional hiera entries' do

spec/acceptance/server/grant_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ class { 'postgresql::server': }
315315
role => $user,
316316
require => [ Postgresql::Server::Role[$user] ],
317317
}
318-
EOS
318+
EOS
319319

320320
pp_revoke = pp_setup + <<-EOS.unindent
321321
@@ -337,7 +337,7 @@ class { 'postgresql::server': }
337337
role => $user,
338338
require => [ Postgresql::Server::Role[$user] ],
339339
}
340-
EOS
340+
EOS
341341

342342
if Gem::Version.new(postgresql_version) >= Gem::Version.new('9.0')
343343
idempotent_apply(pp_create_table)
@@ -376,7 +376,7 @@ class { 'postgresql::server': }
376376
role => $user,
377377
require => [ Postgresql::Server::Role[$user] ],
378378
}
379-
EOS
379+
EOS
380380

381381
pp_revoke = pp_setup + <<-EOS.unindent
382382
@@ -389,7 +389,7 @@ class { 'postgresql::server': }
389389
role => $user,
390390
require => [ Postgresql::Server::Role[$user] ],
391391
}
392-
EOS
392+
EOS
393393

394394
if Gem::Version.new(postgresql_version) >= Gem::Version.new('9.0')
395395
## pp_create_table sets up the permissions that pp_grant 'fixes', so these to steps cannot be rolled into one
@@ -428,7 +428,7 @@ class { 'postgresql::server': }
428428
role => $user,
429429
require => [ Postgresql::Server::Role[$user] ],
430430
}
431-
EOS
431+
EOS
432432

433433
pp_revoke = pp_setup + <<-EOS.unindent
434434
@@ -441,7 +441,7 @@ class { 'postgresql::server': }
441441
role => $user,
442442
require => [ Postgresql::Server::Role[$user] ],
443443
}
444-
EOS
444+
EOS
445445

446446
if Gem::Version.new(postgresql_version) >= Gem::Version.new('9.0')
447447
## pp_create_table sets up the permissions that pp_grant 'fixes', so these to steps cannot be rolled into one
@@ -484,7 +484,7 @@ class { 'postgresql::server': }
484484
db => '#{db}',
485485
role => '#{user}_does_not_exist',
486486
}
487-
EOS
487+
EOS
488488
idempotent_apply(pp)
489489
end
490490
end

spec/acceptance/utf8_encoding_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class { 'postgresql::globals':
1010
locale => 'en_NG',
1111
} ->
1212
class { 'postgresql::server': }
13-
MANIFEST
13+
MANIFEST
1414
end
1515

1616
it 'with defaults' do

0 commit comments

Comments
 (0)