Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7151
Browse files Browse the repository at this point in the history
7151: Bump rubocop to 0.68.0 r=hsbt a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that our rubocop version is getting outdated. Also, I added [a PR to rubocop](rubocop/rubocop#6935) so that we can remove the exclusions in our configuration, and it has now been released.

### What is your fix for the problem, implemented in this PR?

My fix is to update rubocop to the latest version, update the configuration, and fix new offenses.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
  • Loading branch information
bundlerbot and deivid-rodriguez committed Apr 30, 2019
2 parents dd8e145 + bb45625 commit ab47f86
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 32 deletions.
40 changes: 16 additions & 24 deletions .rubocop.yml
@@ -1,3 +1,5 @@
require: rubocop-performance

AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.3
Expand Down Expand Up @@ -219,16 +221,6 @@ Lint/Void:
Layout/AccessModifierIndentation:
Enabled: true
EnforcedStyle: outdent
Exclude:
- 'lib/bundler/cli.rb'
- 'lib/bundler/definition.rb'
- 'lib/bundler/feature_flag.rb'
- 'lib/bundler/gem_helpers.rb'
- 'lib/bundler/index.rb'
- 'lib/bundler/remote_specification.rb'
- 'lib/bundler/shared_helpers.rb'
- 'lib/bundler/source/path.rb'
- 'spec/realworld/gemfile_source_header_spec.rb'

Layout/AlignArray:
Enabled: true
Expand Down Expand Up @@ -309,19 +301,19 @@ Layout/EndOfLine:
Layout/ExtraSpacing:
Enabled: true

Layout/FirstParameterIndentation:
Layout/IndentAssignment:
Enabled: true

Layout/IndentArray:
Layout/IndentFirstArrayElement:
Enabled: true
EnforcedStyle: consistent

Layout/IndentAssignment:
Layout/IndentFirstHashElement:
Enabled: true
EnforcedStyle: special_inside_parentheses

Layout/IndentHash:
Layout/IndentFirstArgument:
Enabled: true
EnforcedStyle: special_inside_parentheses

Layout/IndentationConsistency:
Enabled: true
Expand Down Expand Up @@ -464,21 +456,12 @@ Performance/EndWith:
Performance/FixedSize:
Enabled: true

Performance/LstripRstrip:
Enabled: true

Performance/RedundantSortBy:
Enabled: true

Performance/RegexpMatch:
Enabled: true

Performance/ReverseEach:
Enabled: true

Performance/Sample:
Enabled: true

Performance/Size:
Enabled: true

Expand Down Expand Up @@ -731,6 +714,9 @@ Style/RedundantParentheses:
Style/RedundantSelf:
Enabled: true

Style/RedundantSortBy:
Enabled: true

Style/RegexpLiteral:
Enabled: true

Expand All @@ -740,6 +726,9 @@ Style/RescueModifier:
Style/RescueStandardError:
Enabled: true

Style/Sample:
Enabled: true

Style/SelfAssignment:
Enabled: true

Expand Down Expand Up @@ -768,6 +757,9 @@ Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Style/Strip:
Enabled: true

Style/StructInheritance:
Enabled: true

Expand Down
3 changes: 2 additions & 1 deletion bundler.gemspec
Expand Up @@ -38,7 +38,8 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake", "~> 12.0"
s.add_development_dependency "ronn", "~> 0.7.3"
s.add_development_dependency "rspec", "~> 3.6"
s.add_development_dependency "rubocop", "= 0.65.0"
s.add_development_dependency "rubocop", "= 0.68.0"
s.add_development_dependency "rubocop-performance", "~> 1.1"

s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/friendly_errors.rb
Expand Up @@ -5,7 +5,7 @@

module Bundler
module FriendlyErrors
module_function
module_function # rubocop:disable Layout/AccessModifierIndentation

def log_error(error)
case error
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/gem_version_promoter.rb
Expand Up @@ -81,8 +81,8 @@ def sort_versions(dep, spec_groups)
sort_dep_specs(spec_groups, locked_spec)
end.tap do |specs|
if DEBUG
STDERR.puts before_result
STDERR.puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
warn before_result
warn " after sort_versions: #{debug_format_result(dep, specs).inspect}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/resolver.rb
Expand Up @@ -75,7 +75,7 @@ def debug(depth = 0)
return unless debug?
debug_info = yield
debug_info = debug_info.inspect unless debug_info.is_a?(String)
STDERR.puts debug_info.split("\n").map {|s| " " * depth + s }
warn debug_info.split("\n").map {|s| " " * depth + s }
end

def debug?
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/uri_credentials_filter.rb
Expand Up @@ -2,7 +2,7 @@

module Bundler
module URICredentialsFilter
module_function
module_function # rubocop:disable Layout/AccessModifierIndentation

def credential_filtered_uri(uri_to_anonymize)
return uri_to_anonymize if uri_to_anonymize.nil?
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/yaml_serializer.rb
Expand Up @@ -3,7 +3,7 @@
module Bundler
# A stub yaml serializer that can handle only hashes and strings (as of now).
module YAMLSerializer
module_function
module_function # rubocop:disable Layout/AccessModifierIndentation

def dump(hash)
yaml = String.new("---")
Expand Down
2 changes: 1 addition & 1 deletion spec/realworld/gemfile_source_header_spec.rb
Expand Up @@ -28,7 +28,7 @@
expect(the_bundle).to include_gems "weakling 0.0.3"
end

private
private

def setup_server
require_rack
Expand Down

0 comments on commit ab47f86

Please sign in to comment.