summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-30 00:30:17 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-30 00:30:17 +0200
commitbb456254308acbb89223544db97eb3f1dacacc90 (patch)
tree57b0b8b95522117c545062f6bf0cb2653f50b166
parent896269a45902f587bb722ebbd50dbf1eeee9d25b (diff)
downloadbundler-rubocop_0_68.tar.gz
Bump rubocop to 0.68.0rubocop_0_68
-rw-r--r--.rubocop.yml40
-rw-r--r--bundler.gemspec3
-rw-r--r--lib/bundler/friendly_errors.rb2
-rw-r--r--lib/bundler/gem_version_promoter.rb4
-rw-r--r--lib/bundler/resolver.rb2
-rw-r--r--lib/bundler/uri_credentials_filter.rb2
-rw-r--r--lib/bundler/yaml_serializer.rb2
-rw-r--r--spec/realworld/gemfile_source_header_spec.rb2
8 files changed, 25 insertions, 32 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 586ec9e319..01088346f3 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,3 +1,5 @@
+require: rubocop-performance
+
AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.3
@@ -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
@@ -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
@@ -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
@@ -731,6 +714,9 @@ Style/RedundantParentheses:
Style/RedundantSelf:
Enabled: true
+Style/RedundantSortBy:
+ Enabled: true
+
Style/RegexpLiteral:
Enabled: true
@@ -740,6 +726,9 @@ Style/RescueModifier:
Style/RescueStandardError:
Enabled: true
+Style/Sample:
+ Enabled: true
+
Style/SelfAssignment:
Enabled: true
@@ -768,6 +757,9 @@ Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes
+Style/Strip:
+ Enabled: true
+
Style/StructInheritance:
Enabled: true
diff --git a/bundler.gemspec b/bundler.gemspec
index bcc1027a40..7e5346de36 100644
--- a/bundler.gemspec
+++ b/bundler.gemspec
@@ -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) }
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index 45faf02020..b93ae68012 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -5,7 +5,7 @@ require_relative "vendored_thor"
module Bundler
module FriendlyErrors
- module_function
+ module_function # rubocop:disable Layout/AccessModifierIndentation
def log_error(error)
case error
diff --git a/lib/bundler/gem_version_promoter.rb b/lib/bundler/gem_version_promoter.rb
index ed950ad28b..311b0cbbf3 100644
--- a/lib/bundler/gem_version_promoter.rb
+++ b/lib/bundler/gem_version_promoter.rb
@@ -81,8 +81,8 @@ module Bundler
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
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index d3e5f268cf..c7caf01c7d 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -75,7 +75,7 @@ module Bundler
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?
diff --git a/lib/bundler/uri_credentials_filter.rb b/lib/bundler/uri_credentials_filter.rb
index ee3692268c..0f6ea4cefa 100644
--- a/lib/bundler/uri_credentials_filter.rb
+++ b/lib/bundler/uri_credentials_filter.rb
@@ -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?
diff --git a/lib/bundler/yaml_serializer.rb b/lib/bundler/yaml_serializer.rb
index 374b3bb5e3..1965853931 100644
--- a/lib/bundler/yaml_serializer.rb
+++ b/lib/bundler/yaml_serializer.rb
@@ -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("---")
diff --git a/spec/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb
index eaefd0f03e..382485b8fc 100644
--- a/spec/realworld/gemfile_source_header_spec.rb
+++ b/spec/realworld/gemfile_source_header_spec.rb
@@ -28,7 +28,7 @@ RSpec.describe "fetching dependencies with a mirrored source", :realworld => tru
expect(the_bundle).to include_gems "weakling 0.0.3"
end
- private
+private
def setup_server
require_rack