diff options
author | Homu <homu@barosl.com> | 2015-10-19 09:29:05 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2015-10-19 09:29:05 +0900 |
commit | 282930e09cc4bac1b0f53244d8ec4e9c8caaa197 (patch) | |
tree | 022de0e6fae054e5a2f5608e7fa709b2e0c52e7b | |
parent | 59fd7949c48a9720b47252dbc7e85e514cf9c0b2 (diff) | |
parent | 9ee23a67428d158aee397b84748434726810a445 (diff) | |
download | bundler-282930e09cc4bac1b0f53244d8ec4e9c8caaa197.tar.gz |
Auto merge of #4035 - bundler:seg-update-rubocop, r=segiddins
[RuboCop] Update to 0.34.2
-rw-r--r-- | .rubocop_todo.yml | 187 | ||||
-rw-r--r-- | Rakefile | 4 | ||||
-rwxr-xr-x | bin/rubocop | 2 | ||||
-rwxr-xr-x | exe/bundle_ruby | 2 | ||||
-rw-r--r-- | lib/bundler.rb | 4 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/builders.rb | 5 | ||||
-rw-r--r-- | spec/support/helpers.rb | 2 |
8 files changed, 147 insertions, 63 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 21792ca621..b674f399bb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,5 +1,6 @@ -# This configuration was generated by `rubocop --auto-gen-config` -# on 2015-07-15 20:39:25 -0700 using RuboCop version 0.32.1. +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2015-10-05 08:53:42 -0500 using RuboCop version 0.34.2. # 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 @@ -7,58 +8,82 @@ # Offense count: 4 Lint/Eval: - Enabled: false + Exclude: + - 'lib/bundler.rb' + - 'lib/bundler/endpoint_specification.rb' + - 'spec/support/streams.rb' # Offense count: 5 Lint/HandleExceptions: - Enabled: false + Exclude: + - 'lib/bundler/fetcher/dependency.rb' + - 'lib/bundler/installer.rb' + - 'lib/bundler/psyched_yaml.rb' + - 'lib/bundler/vendored_persistent.rb' # Offense count: 1 Lint/NestedMethodDefinition: - Enabled: false + Exclude: + - 'lib/bundler/graph.rb' # Offense count: 1 Lint/NonLocalExitFromIterator: - Enabled: false + Exclude: + - 'lib/bundler/rubygems_integration.rb' # Offense count: 6 Lint/RescueException: - Enabled: false + Exclude: + - 'lib/bundler/cli.rb' + - 'lib/bundler/dsl.rb' + - 'lib/bundler/friendly_errors.rb' + - 'lib/bundler/installer.rb' + - 'lib/bundler/rubygems_integration.rb' + - 'lib/bundler/worker.rb' # Offense count: 7 Lint/UselessAssignment: - Enabled: false + Exclude: + - 'lib/bundler/graph.rb' + - 'lib/bundler/index.rb' + - 'lib/bundler/installer.rb' -# Offense count: 959 +# Offense count: 1002 # Configuration parameters: AllowURI, URISchemes. Metrics/LineLength: Max: 207 -# Offense count: 4 -# Configuration parameters: CountComments. -Metrics/ModuleLength: - Max: 363 - # Offense count: 2 # Configuration parameters: CountKeywordArgs. Metrics/ParameterLists: Max: 6 -# Offense count: 49 +# Offense count: 50 Metrics/PerceivedComplexity: Max: 54 # Offense count: 1 Style/AccessorMethodName: - Enabled: false + Exclude: + - 'lib/bundler/source/git.rb' # Offense count: 16 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. Style/AndOr: - Enabled: false - -# Offense count: 22 + Exclude: + - 'lib/bundler/gem_helper.rb' + - 'lib/bundler/graph.rb' + - 'lib/bundler/lazy_specification.rb' + - 'lib/bundler/match_platform.rb' + - 'lib/bundler/remote_specification.rb' + - 'lib/bundler/resolver.rb' + - 'lib/bundler/rubygems_integration.rb' + - 'lib/bundler/runtime.rb' + - 'lib/bundler/settings.rb' + - 'spec/support/builders.rb' + +# Offense count: 23 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. Style/BlockDelimiters: @@ -66,7 +91,10 @@ Style/BlockDelimiters: # Offense count: 3 Style/CaseEquality: - Enabled: false + Exclude: + - 'lib/bundler/dsl.rb' + - 'lib/bundler/match_platform.rb' + - 'lib/bundler/rubygems_ext.rb' # Offense count: 4 # Cop supports --auto-correct. @@ -79,52 +107,83 @@ Style/CaseIndentation: Style/ClassAndModuleChildren: Enabled: false -# Offense count: 153 +# Offense count: 117 +# Configuration parameters: Exclude. Style/Documentation: Enabled: false -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. Style/EmptyElse: - Enabled: false + Exclude: + - 'lib/bundler/fetcher.rb' + - 'lib/bundler/ruby_version.rb' -# Offense count: 9 +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. Style/EmptyLinesAroundModuleBody: - Enabled: false + Exclude: + - 'lib/bundler/cli/common.rb' + - 'lib/bundler/deprecate.rb' + - 'lib/bundler/dsl.rb' + - 'lib/bundler/fetcher.rb' + - 'lib/bundler/friendly_errors.rb' + - 'lib/bundler/gem_helpers.rb' + - 'spec/support/builders.rb' + - 'spec/support/indexes.rb' + - 'spec/support/rubygems_ext.rb' # Offense count: 1 # Configuration parameters: Exclude. Style/FileName: - Enabled: false + Exclude: + - 'lib/bundler/templates/Executable' # Offense count: 4 # Configuration parameters: AllowedVariables. Style/GlobalVars: - Enabled: false + Exclude: + - 'lib/bundler/cli.rb' + - 'spec/spec_helper.rb' + - 'spec/support/helpers.rb' -# Offense count: 29 +# Offense count: 30 # Configuration parameters: MinBodyLength. Style/GuardClause: Enabled: false -# Offense count: 20 +# Offense count: 18 # Cop supports --auto-correct. # Configuration parameters: MaxLineLength. Style/IfUnlessModifier: - Enabled: false + Exclude: + - 'lib/bundler.rb' + - 'lib/bundler/cli/install.rb' + - 'lib/bundler/definition.rb' + - 'lib/bundler/dependency.rb' + - 'lib/bundler/fetcher.rb' + - 'lib/bundler/gem_helper.rb' + - 'lib/bundler/lockfile_parser.rb' + - 'lib/bundler/rubygems_integration.rb' + - 'lib/bundler/settings.rb' + - 'lib/bundler/source/git.rb' + - 'lib/bundler/source/git/git_proxy.rb' + - 'spec/support/builders.rb' # Offense count: 2 Style/ModuleFunction: - Enabled: false + Exclude: + - 'lib/bundler/shared_helpers.rb' + - 'spec/support/path.rb' # Offense count: 1 Style/MultilineBlockChain: - Enabled: false + Exclude: + - 'spec/support/less_than_proc.rb' -# Offense count: 13 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. Style/MultilineOperationIndentation: @@ -133,9 +192,16 @@ Style/MultilineOperationIndentation: # Offense count: 10 # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles. Style/Next: - Enabled: false - -# Offense count: 63 + Exclude: + - 'exe/bundle' + - 'exe/bundler' + - 'lib/bundler/definition.rb' + - 'lib/bundler/dsl.rb' + - 'lib/bundler/resolver.rb' + - 'lib/bundler/source/path.rb' + - 'spec/support/artifice/endpoint.rb' + +# Offense count: 67 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: @@ -144,14 +210,28 @@ Style/PercentLiteralDelimiters: # Offense count: 22 # Cop supports --auto-correct. Style/PerlBackrefs: - Enabled: false + Exclude: + - 'exe/bundle' + - 'exe/bundler' + - 'lib/bundler/cli/gem.rb' + - 'lib/bundler/dsl.rb' + - 'lib/bundler/lockfile_parser.rb' + - 'lib/bundler/runtime.rb' + - 'lib/bundler/source/git/git_proxy.rb' + - 'lib/bundler/source/path.rb' # Offense count: 8 # Configuration parameters: NamePrefix, NamePrefixBlacklist. Style/PredicateName: - Enabled: false + Exclude: + - 'lib/bundler/definition.rb' + - 'lib/bundler/installer/parallel_installer.rb' + - 'lib/bundler/settings.rb' + - 'lib/bundler/source/git.rb' + - 'lib/bundler/source/git/git_proxy.rb' + - 'lib/bundler/source/path.rb' -# Offense count: 8 +# Offense count: 6 # Configuration parameters: EnforcedStyle, SupportedStyles. Style/RaiseArgs: Enabled: false @@ -159,19 +239,26 @@ Style/RaiseArgs: # Offense count: 7 # Cop supports --auto-correct. Style/RedundantSelf: - Enabled: false + Exclude: + - 'lib/bundler.rb' + - 'lib/bundler/definition.rb' + - 'lib/bundler/graph.rb' + - 'lib/bundler/rubygems_integration.rb' + - 'lib/bundler/source/rubygems.rb' + - 'spec/support/less_than_proc.rb' + - 'spec/support/ruby_ext.rb' -# Offense count: 3 +# Offense count: 5 +# Cop supports --auto-correct. Style/RescueModifier: - Enabled: false + Exclude: + - 'lib/bundler.rb' + - 'lib/bundler/fetcher.rb' + - 'lib/bundler/resolver.rb' + - 'spec/realworld/dependency_api_spec.rb' -# Offense count: 2 +# Offense count: 1 # Configuration parameters: Methods. Style/SingleLineBlockParams: - Enabled: false - -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/SpaceAroundEqualsInParameterDefault: - Enabled: false + Exclude: + - 'lib/bundler/cli/gem.rb' @@ -33,7 +33,7 @@ namespace :spec do deps = Hash[BUNDLER_SPEC.development_dependencies.map do |d| [d.name, d.requirement.to_s] end] - deps["rubocop"] ||= "= 0.33.0" if RUBY_VERSION >= "1.9.3" # can't go in the gemspec because of the ruby version requirement + deps["rubocop"] ||= "= 0.34.2" if RUBY_VERSION >= "1.9.3" # can't go in the gemspec because of the ruby version requirement # JRuby can't build ronn or rdiscount, so we skip that if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" @@ -88,7 +88,7 @@ begin if RUBY_VERSION >= "1.9.3" # can't go in the gemspec because of the ruby version requirement - gem "rubocop", "= 0.33.0" + gem "rubocop", "= 0.34.2" require "rubocop/rake_task" RuboCop::RakeTask.new end diff --git a/bin/rubocop b/bin/rubocop index 7936c64fa2..f4993c40f3 100755 --- a/bin/rubocop +++ b/bin/rubocop @@ -7,5 +7,5 @@ bundler_spec.dependencies.each do |dep| gem dep.name, dep.requirement.to_s end -gem "rubocop", "= 0.33.0" +gem "rubocop", "= 0.34.2" load Gem.bin_path("rubocop", "rubocop") diff --git a/exe/bundle_ruby b/exe/bundle_ruby index 9bee595265..346dbf2ae2 100755 --- a/exe/bundle_ruby +++ b/exe/bundle_ruby @@ -20,7 +20,7 @@ module Bundler end def eval_gemfile(gemfile, contents = nil) - contents ||= File.open(gemfile, "rb") {|f| f.read } + contents ||= File.open(gemfile, "rb", &:read) instance_eval(contents, gemfile.to_s, 1) rescue SyntaxError => e bt = e.message.split("\n")[1..-1] diff --git a/lib/bundler.rb b/lib/bundler.rb index 4f9413540a..d222befc98 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -110,7 +110,7 @@ module Bundler when :write then "write to" when :executable, :exec then "execute" else @permission_type.to_s - end + end "There was an error while trying to #{action} `#{@path}`. " \ "It is likely that you need to grant #{@permission_type} permissions " \ "for that path." @@ -385,7 +385,7 @@ module Bundler end def read_file(file) - File.open(file, "rb") {|f| f.read } + File.open(file, "rb", &:read) end def load_marshal(data) diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index cd5444e435..fcb955bd4b 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -615,9 +615,7 @@ describe "bundle clean" do end it "doesn't remove extensions artifacts from bundled git gems after clean", :rubygems => "2.2" do - build_git "very_simple_git_binary" do |s| - s.add_c_extension - end + build_git "very_simple_git_binary", &:add_c_extension revision = revision_for(lib_path("very_simple_git_binary-1.0")) diff --git a/spec/support/builders.rb b/spec/support/builders.rb index c4c4181f6a..95b4b6eb59 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -158,9 +158,7 @@ module Spec RUBY end - build_gem "very_simple_binary" do |s| - s.add_c_extension - end + build_gem "very_simple_binary", &:add_c_extension build_gem "bundler", "0.9" do |s| s.executables = "bundle" @@ -507,6 +505,7 @@ module Spec if options[:rubygems_version] @spec.rubygems_version = options[:rubygems_version] def @spec.mark_version; end + def @spec.validate; end end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 4f7190edb2..49d0d6f133 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -176,7 +176,7 @@ module Spec def lockfile(*args) if args.empty? - File.open("Gemfile.lock", "r") {|f| f.read } + File.open("Gemfile.lock", "r", &:read) else create_file("Gemfile.lock", *args) end |