Skip to content

Commit

Permalink
(CONT-792) - Correct Style/TrailingCommaInHashLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Apr 19, 2023
1 parent c4b5bbf commit 83be16e
Show file tree
Hide file tree
Showing 34 changed files with 137 additions and 144 deletions.
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,3 @@ Style/OptionalBooleanParameter:
Exclude:
- 'lib/puppet/functions/postgresql/postgresql_password.rb'
- 'lib/puppet/type/postgresql_psql.rb'

# Offense count: 137
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def default_impl(acls, id, offset)
'type' => parts[0],
'database' => parts[1],
'user' => parts[2],
'order' => '%03d' % (offset + index),
'order' => '%03d' % (offset + index)
}
if parts[0] == 'local'
resource['auth_method'] = parts[3]
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/functions/postgresql/postgresql_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def pg_sha256(password, salt)
iterations: '4096',
salt: Base64.strict_encode64(salt),
client_key: Base64.strict_encode64(client_key(digest)),
server_key: Base64.strict_encode64(server_key(digest)),
server_key: Base64.strict_encode64(server_key(digest))
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/util/postgresql_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def build_psql_cmd
port: '--port',
db_username: '--username',
db_name: '--dbname',
command: '--command',
command: '--command'
}

args.each do |k, v|
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
validcon_script_path: '/opt/bin/my-validate-con.sh',
package_ensure: 'absent',
package_name: 'mypackage',
file_ensure: 'file',
file_ensure: 'file'
}
end

Expand Down Expand Up @@ -50,7 +50,7 @@ class { 'postgresql::globals':
describe 'with client package name explicitly set undef' do
let :params do
{
package_name: 'UNSET',
package_name: 'UNSET'
}
end

Expand Down
6 changes: 3 additions & 3 deletions spec/classes/globals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
describe 'manage_package_repo => true' do
let(:params) do
{
manage_package_repo: true,
manage_package_repo: true
}
end

Expand All @@ -38,7 +38,7 @@
let(:params) do
{
manage_package_repo: true,
repo_proxy: 'http://proxy-server:8080',
repo_proxy: 'http://proxy-server:8080'
}
end

Expand All @@ -63,7 +63,7 @@
{
manage_package_repo: true,
repo_baseurl: 'http://mirror.localrepo.com/pgdg-postgresql',
yum_repo_commonurl: 'http://mirror.localrepo.com/pgdg-common',
yum_repo_commonurl: 'http://mirror.localrepo.com/pgdg-common'
}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/lib/devel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
describe 'disable link_pg_config' do
let(:params) do
{
link_pg_config: false,
link_pg_config: false
}
end

Expand Down Expand Up @@ -48,7 +48,7 @@
include_examples 'Gentoo'
let :params do
{
link_pg_config: false,
link_pg_config: false
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/server/contrib_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
let(:params) do
{
package_name: 'mypackage',
package_ensure: 'absent',
package_ensure: 'absent'
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/server/plperl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
let :params do
{
package_ensure: 'absent',
package_name: 'mypackage',
package_name: 'mypackage'
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/server/plpython_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
let :params do
{
package_ensure: 'absent',
package_name: 'mypackage',
package_name: 'mypackage'
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/server/postgis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let(:params) do
{
package_name: 'mypackage',
package_ensure: 'absent',
package_ensure: 'absent'
}
end

Expand Down
26 changes: 13 additions & 13 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class { 'postgresql::globals':
let(:params) do
{
service_ensure: 'running',
postgres_password: 'new-p@s$word-to-set',
postgres_password: 'new-p@s$word-to-set'
}
end

Expand All @@ -76,7 +76,7 @@ class { 'postgresql::globals':
let(:params) do
{
service_ensure: true,
postgres_password: 'new-p@s$word-to-set',
postgres_password: 'new-p@s$word-to-set'
}
end

Expand Down Expand Up @@ -171,7 +171,7 @@ class { 'postgresql::globals':
describe 'package_ensure => absent' do
let(:params) do
{
package_ensure: 'absent',
package_ensure: 'absent'
}
end

Expand All @@ -187,7 +187,7 @@ class { 'postgresql::globals':
describe 'needs_initdb => true' do
let(:params) do
{
needs_initdb: true,
needs_initdb: true
}
end

Expand Down Expand Up @@ -219,8 +219,8 @@ class { 'postgresql::globals':
let(:params) do
{
roles: {
username: { createdb: true },
},
username: { createdb: true }
}
}
end

Expand All @@ -234,8 +234,8 @@ class { 'postgresql::globals':
config_entries: {
fsync: 'off',
checkpoint_segments: '20',
remove_me: :undef,
},
remove_me: :undef
}
}
end

Expand All @@ -254,9 +254,9 @@ class { 'postgresql::globals':
database: 'mydb',
user: 'myuser',
auth_method: 'md5',
address: '192.0.2.100',
},
},
address: '192.0.2.100'
}
}
}
end

Expand Down Expand Up @@ -291,8 +291,8 @@ class { 'postgresql::globals':
db_user: 'backupuser',
db_password: 'backuppass',
dir: '/tmp/backuptest',
manage_user: true,
},
manage_user: true
}
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/defines/server/database_grant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
privilege: 'ALL',
db: 'test',
role: 'test',
role: 'test'
}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/defines/server/db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
user: 'test',
password: 'test',
owner: 'tester',
owner: 'tester'
}
end

Expand All @@ -34,7 +34,7 @@
dbname: 'testtest',
user: 'test',
password: 'test',
owner: 'tester',
owner: 'tester'
}
end

Expand Down
28 changes: 14 additions & 14 deletions spec/defines/server/default_privileges_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
db: 'test',
role: 'test',
privilege: 'all',
object_type: 'tables',
object_type: 'tables'
}
end

Expand All @@ -34,7 +34,7 @@
db: 'test',
role: 'test',
privilege: 'aLl',
object_type: 'TaBlEs',
object_type: 'TaBlEs'
}
end

Expand All @@ -58,7 +58,7 @@
db: 'test',
role: 'test',
privilege: 'all',
object_type: 'wrong_type',
object_type: 'wrong_type'
}
end

Expand All @@ -77,7 +77,7 @@
db: 'test',
role: 'test',
privilege: 'all',
object_type: 'tables',
object_type: 'tables'
}
end

Expand All @@ -103,7 +103,7 @@
db: 'test',
role: 'test',
privilege: 'wrong_privilege',
object_type: 'tables',
object_type: 'tables'
}
end

Expand All @@ -123,7 +123,7 @@
role: 'test',
privilege: 'all',
object_type: 'schemas',
schema: '',
schema: ''
}
end

Expand All @@ -143,7 +143,7 @@
role: 'test',
privilege: 'all',
object_type: 'schemas',
schema: '',
schema: ''
}
end

Expand Down Expand Up @@ -177,7 +177,7 @@ class { 'postgresql::server': }
role: 'test',
privilege: 'all',
object_type: 'schemas',
schema: 'public',
schema: 'public'
}
end

Expand All @@ -202,7 +202,7 @@ class { 'postgresql::server': }
privilege: 'all',
object_type: 'tables',
connect_settings: { 'PGHOST' => 'postgres-db-server',
'DBVERSION' => '9.6' },
'DBVERSION' => '9.6' }
}
end

Expand All @@ -224,7 +224,7 @@ class { 'postgresql::server': }
object_type: 'tables',
connect_settings: { 'PGHOST' => 'postgres-db-server',
'DBVERSION' => '9.6',
'PGPORT' => '1234' },
'PGPORT' => '1234' }
}
end

Expand All @@ -247,7 +247,7 @@ class { 'postgresql::server': }
connect_settings: { 'PGHOST' => 'postgres-db-server',
'DBVERSION' => '9.6',
'PGPORT' => '1234' },
port: 5678,
port: 5678
}
end

Expand Down Expand Up @@ -320,7 +320,7 @@ class { 'postgresql::server': }
db: 'test',
role: 'test',
privilege: 'all',
object_type: 'tables',
object_type: 'tables'
}
end

Expand Down Expand Up @@ -348,7 +348,7 @@ class {'postgresql::server':}
db: 'test',
role: 'test',
privilege: 'all',
object_type: 'tables',
object_type: 'tables'
}
end

Expand Down Expand Up @@ -384,7 +384,7 @@ class {'postgresql::server':}
psql_user: 'postgres',
psql_db: 'db',
port: 1542,
connect_settings: { 'DBVERSION' => '9.6' },
connect_settings: { 'DBVERSION' => '9.6' }
}
end

Expand Down
Loading

0 comments on commit 83be16e

Please sign in to comment.