mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Merge pull request #191 from glennsarti/maint-rubocop
(maint) Fix rubocop offenses
This commit is contained in:
commit
04124a0e7a
4 changed files with 22 additions and 41 deletions
|
|
@ -29,13 +29,15 @@ Metrics/PerceivedComplexity:
|
|||
Enabled: false
|
||||
Metrics/CyclomaticComplexity:
|
||||
Enabled: false
|
||||
# - Long Methods, Classes and blocks
|
||||
# - Long Methods, Classes, Blocks, and Modules
|
||||
Metrics/MethodLength:
|
||||
Enabled: false
|
||||
Metrics/ClassLength:
|
||||
Enabled: false
|
||||
Metrics/BlockLength:
|
||||
Enabled: false
|
||||
Metrics/ModuleLength:
|
||||
Enabled: false
|
||||
|
||||
|
||||
# Either sytnax for regex is ok
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2017-02-10 13:29:15 -0800 using RuboCop version 0.47.1.
|
||||
# on 2017-03-02 20:16:29 -0800 using RuboCop version 0.47.1.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
|
|
@ -51,11 +51,6 @@ Lint/UselessAssignment:
|
|||
Metrics/BlockNesting:
|
||||
Max: 5
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ModuleLength:
|
||||
Max: 289
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountKeywordArgs.
|
||||
Metrics/ParameterLists:
|
||||
|
|
@ -68,12 +63,6 @@ Performance/RedundantMatch:
|
|||
- 'lib/vmpooler/api/v1.rb'
|
||||
- 'lib/vmpooler/vsphere_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Security/YAMLLoad:
|
||||
Exclude:
|
||||
- 'lib/vmpooler.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
|
||||
|
|
@ -115,7 +104,7 @@ Style/CaseEquality:
|
|||
Exclude:
|
||||
- 'lib/vmpooler/api/helpers.rb'
|
||||
|
||||
# Offense count: 12
|
||||
# Offense count: 13
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentOneStep, IndentationWidth.
|
||||
# SupportedStyles: case, end
|
||||
|
|
@ -125,14 +114,6 @@ Style/CaseIndentation:
|
|||
- 'lib/vmpooler/api/v1.rb'
|
||||
- 'lib/vmpooler/vsphere_helper.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
# SupportedStyles: is_a?, kind_of?
|
||||
Style/ClassCheck:
|
||||
Exclude:
|
||||
- 'lib/vmpooler.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Style/ClosingParenthesisIndentation:
|
||||
|
|
@ -415,13 +396,12 @@ Style/SpaceAfterNot:
|
|||
Exclude:
|
||||
- 'lib/vmpooler/pool_manager.rb'
|
||||
|
||||
# Offense count: 9
|
||||
# Offense count: 7
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
# SupportedStyles: space, no_space
|
||||
Style/SpaceAroundEqualsInParameterDefault:
|
||||
Exclude:
|
||||
- 'lib/vmpooler.rb'
|
||||
- 'lib/vmpooler/api/helpers.rb'
|
||||
- 'lib/vmpooler/pool_manager.rb'
|
||||
- 'lib/vmpooler/vsphere_helper.rb'
|
||||
|
|
@ -462,11 +442,10 @@ Style/SpaceInsideParens:
|
|||
Exclude:
|
||||
- 'lib/vmpooler/api/v1.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
Style/SpaceInsidePercentLiteralDelimiters:
|
||||
Exclude:
|
||||
- 'lib/vmpooler.rb'
|
||||
- 'lib/vmpooler/api.rb'
|
||||
|
||||
# Offense count: 47
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ module Vmpooler
|
|||
|
||||
if ENV['VMPOOLER_CONFIG']
|
||||
# Load configuration from ENV
|
||||
parsed_config = YAML.load(ENV['VMPOOLER_CONFIG'])
|
||||
parsed_config = YAML.safe_load(ENV['VMPOOLER_CONFIG'])
|
||||
else
|
||||
# Load the configuration file from disk
|
||||
config_file = File.expand_path(filepath)
|
||||
|
|
@ -37,8 +37,8 @@ module Vmpooler
|
|||
if parsed_config[:auth]['provider'] == 'dummy'
|
||||
unless ENV['VMPOOLER_DEBUG']
|
||||
warning = [
|
||||
"Dummy authentication should not be used outside of debug mode",
|
||||
"please set environment variable VMPOOLER_DEBUG to 'true' if you want to use dummy authentication",
|
||||
'Dummy authentication should not be used outside of debug mode',
|
||||
'please set environment variable VMPOOLER_DEBUG to \'true\' if you want to use dummy authentication'
|
||||
]
|
||||
|
||||
raise warning.join(";\s")
|
||||
|
|
@ -60,13 +60,13 @@ module Vmpooler
|
|||
parsed_config[:pools].each do |pool|
|
||||
parsed_config[:pool_names] << pool['name']
|
||||
if pool['alias']
|
||||
if pool['alias'].kind_of?(Array)
|
||||
if pool['alias'].is_a?(Array)
|
||||
pool['alias'].each do |a|
|
||||
parsed_config[:alias] ||= {}
|
||||
parsed_config[:alias][a] = pool['name']
|
||||
parsed_config[:pool_names] << a
|
||||
end
|
||||
elsif pool['alias'].kind_of?(String)
|
||||
elsif pool['alias'].is_a?(String)
|
||||
parsed_config[:alias][pool['alias']] = pool['name']
|
||||
parsed_config[:pool_names] << pool['alias']
|
||||
end
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ module Vmpooler
|
|||
|
||||
unless maxloop.zero?
|
||||
break if loop_count >= maxloop
|
||||
loop_count = loop_count + 1
|
||||
loop_count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -468,7 +468,7 @@ module Vmpooler
|
|||
|
||||
unless maxloop.zero?
|
||||
break if loop_count >= maxloop
|
||||
loop_count = loop_count + 1
|
||||
loop_count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -582,7 +582,7 @@ module Vmpooler
|
|||
|
||||
unless maxloop.zero?
|
||||
break if loop_count >= maxloop
|
||||
loop_count = loop_count + 1
|
||||
loop_count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -773,7 +773,7 @@ module Vmpooler
|
|||
|
||||
unless maxloop.zero?
|
||||
break if loop_count >= maxloop
|
||||
loop_count = loop_count + 1
|
||||
loop_count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue