(rubocop) Fix Style/TrailingCommaInHashLiteral

This commit is contained in:
Tim Sharpe 2019-02-03 11:27:53 +11:00
parent 1aea79a9a1
commit 58f64b2843
6 changed files with 19 additions and 17 deletions

View file

@ -6,3 +6,5 @@ Style/Documentation:
Enabled: False
Style/HashSyntax:
EnforcedStyle: hash_rockets
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

View file

@ -155,7 +155,7 @@ class Vmfloaty
:lifetime => options.lifetime,
:disk => options.disk,
:tags => tags,
:reason => options.reason
:reason => options.reason,
}
modify_hash.delete_if { |_, value| value.nil? }

View file

@ -179,7 +179,7 @@ class Utils
'url' => config['url'],
'user' => config['user'],
'token' => config['token'],
'type' => config['type'] || 'vmpooler'
'type' => config['type'] || 'vmpooler',
}
if config['services']

View file

@ -12,13 +12,13 @@ describe NonstandardPooler do
'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent' => 'Faraday v0.9.2',
'X-Auth-Token' => 'token-value'
'X-Auth-Token' => 'token-value',
}
@get_request_headers = {
'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent' => 'Faraday v0.9.2',
'X-Auth-Token' => 'token-value'
'X-Auth-Token' => 'token-value',
}
@get_request_headers_notoken = @get_request_headers.tap do |headers|
headers.delete('X-Auth-Token')

View file

@ -60,7 +60,7 @@ describe Service do
it 'reports the status of a token' do
config = {
'user' => 'first.last',
'url' => 'http://default.url'
'url' => 'http://default.url',
}
options = MockOptions.new('token' => 'token-value')
service = Service.new(options, config)
@ -69,7 +69,7 @@ describe Service do
'user' => config['user'],
'created' => '2017-09-22 02:04:18 +0000',
'last_accessed' => '2017-09-22 02:04:28 +0000',
'reserved_hosts' => []
'reserved_hosts' => [],
}
allow(Auth).to(receive(:token_status)
.with(nil, config['url'], 'token-value')

View file

@ -47,11 +47,11 @@ describe Utils do
before :each do
@vmpooler_results = {
'centos-7-x86_64' => ['dlgietfmgeegry2.delivery.mycompany.net'],
'ubuntu-1610-x86_64' => ['gdoy8q3nckuob0i.delivery.mycompany.net', 'ctnktsd0u11p9tm.delivery.mycompany.net']
'ubuntu-1610-x86_64' => ['gdoy8q3nckuob0i.delivery.mycompany.net', 'ctnktsd0u11p9tm.delivery.mycompany.net'],
}
@nonstandard_results = {
'solaris-10-sparc' => ['sol10-10.delivery.mycompany.net', 'sol10-11.delivery.mycompany.net'],
'ubuntu-16.04-power8' => ['power8-ubuntu16.04-6.delivery.mycompany.net']
'ubuntu-16.04-power8' => ['power8-ubuntu16.04-6.delivery.mycompany.net'],
}
@vmpooler_output = <<-OUT.chomp
- dlgietfmgeegry2.delivery.mycompany.net (centos-7-x86_64)
@ -95,14 +95,14 @@ describe Utils do
'vm' => {
'url' => 'http://vmpooler.url',
'user' => 'first.last.vmpooler',
'token' => 'vmpooler-token'
'token' => 'vmpooler-token',
},
'ns' => {
'url' => 'http://nspooler.url',
'user' => 'first.last.nspooler',
'token' => 'nspooler-token'
}
}
'token' => 'nspooler-token',
},
},
}
end
@ -166,7 +166,7 @@ describe Utils do
'running' => 9.66,
'state' => 'running',
'ip' => '127.0.0.1',
'domain' => 'delivery.mycompany.net'
'domain' => 'delivery.mycompany.net',
}}
output = '- mcpy42eqjxli9g2.delivery.mycompany.net (ubuntu-1604-x86_64, 9.66/12 hours)'
@ -189,10 +189,10 @@ describe Utils do
'state' => 'running',
'tags' => {
'user' => 'bob',
'role' => 'agent'
'role' => 'agent',
},
'ip' => '127.0.0.1',
'domain' => 'delivery.mycompany.net'
'domain' => 'delivery.mycompany.net',
}}
output = '- aiydvzpg23r415q.delivery.mycompany.net (redhat-7-x86_64, 7.67/48 hours, user: bob, role: agent)'
@ -213,7 +213,7 @@ describe Utils do
'os_triple' => 'solaris-11-sparc',
'reserved_by_user' => 'first.last',
'reserved_for_reason' => '',
'hours_left_on_reservation' => 35.89
'hours_left_on_reservation' => 35.89,
}}
output = '- sol11-9.delivery.mycompany.net (solaris-11-sparc, 35.89h remaining)'
@ -234,7 +234,7 @@ describe Utils do
'os_triple' => 'solaris-11-sparc',
'reserved_by_user' => 'first.last',
'reserved_for_reason' => 'testing',
'hours_left_on_reservation' => 35.89
'hours_left_on_reservation' => 35.89,
}}
output = '- sol11-9.delivery.mycompany.net (solaris-11-sparc, 35.89h remaining, reason: testing)'