Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Fix rubocop violations #208

Merged
merged 4 commits into from
Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Style/Documentation:
Metrics/LineLength:
Enabled: false

# Empty method definitions over more than one line is ok
Style/EmptyMethod:
Enabled: false

# Due to legacy codebase
# - Globals are used liberally
Expand All @@ -29,6 +32,8 @@ Metrics/PerceivedComplexity:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/BlockNesting:
Enabled: false
# - Long Methods, Classes, Blocks, and Modules
Metrics/MethodLength:
Enabled: false
Expand All @@ -39,6 +44,9 @@ Metrics/BlockLength:
Metrics/ModuleLength:
Enabled: false

# WordArray is crashing rubocop in lib/vmpooler/api/helpers.rb
Style/WordArray:
Enabled: false

# Either sytnax for regex is ok
Style/RegexpLiteral:
Expand Down
51 changes: 7 additions & 44 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-03-02 20:16:29 -0800 using RuboCop version 0.47.1.
# on 2017-03-16 15:37:18 -0700 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
Expand All @@ -13,10 +13,9 @@ Lint/AssignmentInCondition:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'

# Offense count: 6
# Offense count: 5
Lint/ConditionPosition:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
- 'lib/vmpooler/pool_manager.rb'

# Offense count: 3
Expand All @@ -30,13 +29,12 @@ Lint/ShadowingOuterLocalVariable:
Exclude:
- 'lib/vmpooler/api/helpers.rb'

# Offense count: 8
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/dummy_statsd.rb'
- 'lib/vmpooler/pool_manager.rb'
- 'lib/vmpooler/vsphere_helper.rb'

Expand All @@ -46,11 +44,6 @@ Lint/UselessAssignment:
- 'lib/vmpooler/api/dashboard.rb'
- 'lib/vmpooler/api/helpers.rb'

# Offense count: 5
# Configuration parameters: CountBlocks.
Metrics/BlockNesting:
Max: 5

# Offense count: 1
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Expand Down Expand Up @@ -134,13 +127,12 @@ Style/EmptyLines:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'

# Offense count: 2
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Style/EmptyLinesAroundClassBody:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
- 'lib/vmpooler/api/helpers.rb'

# Offense count: 3
Expand All @@ -151,27 +143,12 @@ Style/EmptyLinesAroundModuleBody:
Exclude:
- 'lib/vmpooler/api/helpers.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/EmptyLiteral:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Exclude:
- 'lib/vmpooler/dummy_statsd.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Style/ExtraSpacing:
Exclude:
- 'lib/vmpooler/pool_manager.rb'
- 'lib/vmpooler/statsd.rb'

# Offense count: 2
# Cop supports --auto-correct.
Expand Down Expand Up @@ -244,13 +221,11 @@ Style/IndentHash:
- 'lib/vmpooler/api/helpers.rb'
- 'lib/vmpooler/api/v1.rb'

# Offense count: 4
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Width.
Style/IndentationWidth:
Exclude:
- 'lib/vmpooler/api/dashboard.rb'
- 'lib/vmpooler/api/reroute.rb'
- 'lib/vmpooler/api/v1.rb'
- 'lib/vmpooler/vsphere_helper.rb'

Expand Down Expand Up @@ -412,13 +387,12 @@ Style/SpaceAroundKeyword:
Exclude:
- 'lib/vmpooler/api/v1.rb'

# Offense count: 4
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Style/SpaceAroundOperators:
Exclude:
- 'lib/vmpooler/api/v1.rb'
- 'lib/vmpooler/statsd.rb'

# Offense count: 4
# Cop supports --auto-correct.
Expand All @@ -442,25 +416,14 @@ Style/SpaceInsideParens:
Exclude:
- 'lib/vmpooler/api/v1.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/SpaceInsidePercentLiteralDelimiters:
Exclude:
- 'lib/vmpooler/api.rb'

# Offense count: 47
# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'lib/vmpooler/api.rb'
- 'lib/vmpooler/api/dashboard.rb'
- 'lib/vmpooler/api/reroute.rb'
- 'lib/vmpooler/api/v1.rb'
- 'lib/vmpooler/graphite.rb'
- 'lib/vmpooler/pool_manager.rb'
- 'lib/vmpooler/statsd.rb'
- 'lib/vmpooler/vsphere_helper.rb'
- 'vmpooler'

Expand Down
4 changes: 2 additions & 2 deletions lib/vmpooler/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def initialize

# Load dashboard components
begin
require "dashboard"
require 'dashboard'
rescue LoadError
require File.expand_path(File.join(File.dirname(__FILE__), 'dashboard'))
end

use Vmpooler::Dashboard

# Load API components
%w( helpers dashboard reroute v1 ).each do |lib|
%w(helpers dashboard reroute v1).each do |lib|
begin
require "api/#{lib}"
rescue LoadError
Expand Down
Loading