Skip to content

Commit

Permalink
Merge pull request #62 from CocoaPods/seg-rubocop-0.38
Browse files Browse the repository at this point in the history
[Bundle] Update RuboCop
  • Loading branch information
segiddins committed Mar 10, 2016
2 parents d9c7016 + a34daf5 commit 90b7d53
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .rubocop.yml
@@ -1,2 +1,3 @@
inherit_from:
- .rubocop_cocoapods.yml
- .rubocop_todo.yml
- .rubocop_cocoapods.yml
21 changes: 19 additions & 2 deletions .rubocop_cocoapods.yml
Expand Up @@ -5,6 +5,7 @@ AllCops:
- ./*.gemspec
Exclude:
- ./spec/fixtures/**/*
- ./vendor/bundle/**/*

# At the moment not ready to be used
# https://github.com/bbatsov/rubocop/issues/947
Expand Down Expand Up @@ -39,7 +40,10 @@ Encoding:

# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
TrailingComma:
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma

Style/MultilineOperationIndentation:
Expand All @@ -58,6 +62,11 @@ Next:
Metrics/ClassLength:
Enabled: false

# Arbitrary max lengths for modules simply do not work and enabling this will
# lead to a never ending stream of annoyance and changes.
Metrics/ModuleLength:
Enabled: false

# Arbitrary max lengths for methods simply do not work and enabling this will
# lead to a never ending stream of annoyance and changes.
Metrics/MethodLength:
Expand All @@ -77,6 +86,11 @@ Metrics/AbcSize:
Metrics/CyclomaticComplexity:
Enabled: false

# It will be obvious which code is complex, Rubocop should only lint simple
# rules for us.
Metrics/PerceivedComplexity:
Enabled: false

#- CocoaPods support for Ruby 1.8.7 ------------------------------------------#

HashSyntax:
Expand All @@ -101,6 +115,10 @@ AmbiguousRegexpLiteral:
Exclude:
- spec/**/*

Performance/RedundantMatch:
Exclude:
- spec/**/*

# Allow `object.should == object` syntax.
Void:
Exclude:
Expand All @@ -113,4 +131,3 @@ ClassAndModuleChildren:
UselessComparison:
Exclude:
- spec/**/*

70 changes: 70 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,70 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-03-09 18:40:14 -0600 using RuboCop version 0.38.0.
# 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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/claide/command.rb'

# Offense count: 1
# Cop supports --auto-correct.
Lint/UnneededDisable:
Exclude:
- 'spec/command/banner_spec.rb'

# Offense count: 1
Performance/FixedSize:
Exclude:
- 'lib/claide/command/banner.rb'

# Offense count: 1
# Cop supports --auto-correct.
Performance/StringReplacement:
Exclude:
- 'lib/claide/command/banner.rb'

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: prefer_alias, prefer_alias_method
Style/Alias:
Exclude:
- 'lib/claide/argument.rb'
- 'lib/claide/command.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: SingleLineConditionsOnly.
Style/ConditionalAssignment:
Exclude:
- 'lib/claide/command/banner.rb'

# Offense count: 1
Style/IfInsideElse:
Exclude:
- 'lib/claide/command.rb'

# Offense count: 9
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'lib/claide/ansi.rb'
- 'lib/claide/argument.rb'
- 'lib/claide/command.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/claide/command/argument_suggester.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/claide/command/argument_suggester.rb'
17 changes: 8 additions & 9 deletions Gemfile.lock
Expand Up @@ -7,8 +7,6 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.2.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
bacon (1.2.0)
codeclimate-test-reporter (0.4.1)
simplecov (>= 0.7.1, < 1.0.0)
Expand All @@ -32,28 +30,29 @@ GEM
notify (0.5.2)
parser (2.3.0.6)
ast (~> 2.2)
powerpack (0.1.0)
powerpack (0.1.1)
prettybacon (0.0.2)
bacon (~> 1.2)
rainbow (2.0.0)
rainbow (2.1.0)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.3)
ffi (>= 0.5.0)
rubocop (0.29.1)
astrolabe (~> 1.3)
parser (>= 2.2.0.1, < 3.0)
rubocop (0.38.0)
parser (>= 2.3.0.6, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.7.1)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.7.5)
simplecov (0.9.1)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
unicode-display_width (1.0.1)

PLATFORMS
ruby
Expand Down
3 changes: 0 additions & 3 deletions lib/claide/command/argument_suggester.rb
Expand Up @@ -81,8 +81,6 @@ def self.prettify_suggestion(suggestion, argument_type)
# The second string to compare.
#
# @return [Fixnum] The distance between the strings.
#
# rubocop:disable all
def self.levenshtein_distance(a, b)
a, b = a.downcase, b.downcase
costs = Array(0..b.length)
Expand All @@ -96,7 +94,6 @@ def self.levenshtein_distance(a, b)
end
costs[b.length]
end
# rubocop:enable all
end
end
end
2 changes: 0 additions & 2 deletions spec/command/banner_spec.rb
Expand Up @@ -243,7 +243,6 @@ class Banner
TextWrapper.wrap_formatted_text(string, 0, 20).should == result
end

# rubocop:disable all
it 'handles multi-line code blocks regarding indentation' do
string = <<-DOC.strip_margin('|').rstrip
|Examples:
Expand All @@ -262,7 +261,6 @@ class Banner
DOC
TextWrapper.wrap_formatted_text(string, 2, 20).should == result
end
# rubocop:enable all
end

describe '::wrap_with_indent' do
Expand Down

0 comments on commit 90b7d53

Please sign in to comment.