diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-06-20 10:03:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-20 10:03:20 -0700 |
commit | 413b52cbeee07f5c772e4b430b06afd29470447a (patch) | |
tree | 884391f50dd4dde11231653cda860ef5eea44e56 | |
parent | 1b48be5de30aa9f5087d459d8bec20388c71a457 (diff) | |
parent | 0734ceaf3eb333fe221efdcca3c45a22e261d3b7 (diff) | |
download | chef-413b52cbeee07f5c772e4b430b06afd29470447a.tar.gz |
Merge pull request #6228 from chef/lcg/bump-rubocop
bump rubocop to 0.49.1
-rw-r--r-- | Gemfile.lock | 19 | ||||
-rw-r--r-- | lib/chef/provider/group/aix.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/group/groupadd.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/user/pw.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/user/windows.rb | 2 | ||||
-rw-r--r-- | spec/integration/knife/cookbook_bulk_delete_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/knife/cookbook_show_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/knife/environment_compare_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/knife/environment_show_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/knife/role_show_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/shared/unit/provider/useradd_based_user_provider.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/group/groupadd_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/user/pw_spec.rb | 2 |
13 files changed, 27 insertions, 26 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 5e81afa4cf..d2a310c721 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ GIT remote: https://github.com/chef/chefstyle.git - revision: 69c1c0d07aa4613bcdc3454767c9fb0d5ee9b36b + revision: e6b966a18dc4a12b4dfa49ccb911dad7432ca4fd branch: master specs: - chefstyle (0.5.0) - rubocop (= 0.47.1) + chefstyle (0.6.0) + rubocop (= 0.49.1) GIT remote: https://github.com/chef/github-changelog-generator @@ -144,13 +144,13 @@ GEM debug_inspector (0.0.3) diff-lcs (1.3) docile (1.1.5) - docker-api (1.33.4) + docker-api (1.33.5) excon (>= 0.38.0) json erubis (2.7.0) ethon (0.10.1) ffi (>= 1.3.0) - excon (0.56.0) + excon (0.57.0) faraday (0.12.1) multipart-post (>= 1.2, < 3) faraday-http-cache (2.0.0) @@ -181,7 +181,7 @@ GEM httpclient (2.8.3) i18n (0.8.4) iniparse (1.4.3) - inspec (1.27.0) + inspec (1.28.1) addressable (~> 2.4) faraday (>= 0.9.0) hashie (~> 3.4) @@ -308,7 +308,8 @@ GEM rspec_junit_formatter (0.2.3) builder (< 4) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.47.1) + rubocop (0.49.1) + parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) @@ -348,7 +349,7 @@ GEM toml (0.1.2) parslet (~> 1.5.0) tomlrb (1.2.4) - train (0.24.0) + train (0.25.0) docker-api (~> 1.26) json (>= 1.8, < 3.0) mixlib-shellout (~> 2.0) @@ -369,7 +370,7 @@ GEM ethon (>= 0.8.0) tzinfo (1.2.3) thread_safe (~> 0.1) - unicode-display_width (1.2.1) + unicode-display_width (1.3.0) uuidtools (2.1.5) websocket (1.2.4) win32-api (1.5.3-universal-mingw32) diff --git a/lib/chef/provider/group/aix.rb b/lib/chef/provider/group/aix.rb index 2db6dc32a7..405e43cff2 100644 --- a/lib/chef/provider/group/aix.rb +++ b/lib/chef/provider/group/aix.rb @@ -63,7 +63,7 @@ class Chef def set_options opts = [] - { gid: "id" }.sort { |a, b| a[0] <=> b[0] }.each do |field, option| + { gid: "id" }.sort_by { |a| a[0] }.each do |field, option| next unless current_resource.send(field) != new_resource.send(field) if new_resource.send(field) Chef::Log.debug("#{new_resource} setting #{field} to #{new_resource.send(field)}") diff --git a/lib/chef/provider/group/groupadd.rb b/lib/chef/provider/group/groupadd.rb index f73c3b3be9..7826078e55 100644 --- a/lib/chef/provider/group/groupadd.rb +++ b/lib/chef/provider/group/groupadd.rb @@ -108,7 +108,7 @@ class Chef # <string>:: A string containing the option and then the quoted value def set_options opts = [] - { gid: "-g" }.sort { |a, b| a[0] <=> b[0] }.each do |field, option| + { gid: "-g" }.sort_by { |a| a[0] }.each do |field, option| next unless current_resource.send(field) != new_resource.send(field) next unless new_resource.send(field) opts << option diff --git a/lib/chef/provider/user/pw.rb b/lib/chef/provider/user/pw.rb index 06bd221d26..48c05cc436 100644 --- a/lib/chef/provider/user/pw.rb +++ b/lib/chef/provider/user/pw.rb @@ -74,7 +74,7 @@ class Chef "uid" => "-u", "shell" => "-s", } - field_list.sort { |a, b| a[0] <=> b[0] }.each do |field, option| + field_list.sort_by { |a| a[0] }.each do |field, option| field_symbol = field.to_sym next unless current_resource.send(field_symbol) != new_resource.send(field_symbol) if new_resource.send(field_symbol) diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 00a825ecab..2b69197626 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -107,7 +107,7 @@ class Chef "password" => "password", } - field_list.sort { |a, b| a[0] <=> b[0] }.each do |field, option| + field_list.sort_by { |a| a[0] }.each do |field, option| field_symbol = field.to_sym next unless current_resource.send(field_symbol) != new_resource.send(field_symbol) next unless new_resource.send(field_symbol) diff --git a/spec/integration/knife/cookbook_bulk_delete_spec.rb b/spec/integration/knife/cookbook_bulk_delete_spec.rb index 4740813ce1..912bd3bed5 100644 --- a/spec/integration/knife/cookbook_bulk_delete_spec.rb +++ b/spec/integration/knife/cookbook_bulk_delete_spec.rb @@ -34,7 +34,7 @@ describe "knife cookbook bulk delete", :workstation do cookbook "zfa", "0.6.5" end - # rubocop:disable Style/TrailingWhitespace + # rubocop:disable Layout/TrailingWhitespace it "knife cookbook bulk delete deletes all matching cookbooks" do stdout = <<EOM All versions of the following cookbooks will be deleted: @@ -58,7 +58,7 @@ fax 0.6.0 zfa 0.6.5 EOM end - # rubocop:enable Style/TrailingWhitespace + # rubocop:enable Layout/TrailingWhitespace end end diff --git a/spec/integration/knife/cookbook_show_spec.rb b/spec/integration/knife/cookbook_show_spec.rb index 1ccf7ffcb7..b89a26198a 100644 --- a/spec/integration/knife/cookbook_show_spec.rb +++ b/spec/integration/knife/cookbook_show_spec.rb @@ -34,7 +34,7 @@ describe "knife cookbook show", :workstation do knife("cookbook show x").should_succeed "x 1.0.0 0.6.5\n" end - # rubocop:disable Style/TrailingWhitespace + # rubocop:disable Layout/TrailingWhitespace it "knife cookbook show x 1.0.0 shows the correct version" do knife("cookbook show x 1.0.0").should_succeed <<EOM cookbook_name: x @@ -127,7 +127,7 @@ specificity: default url: http://127.0.0.1:8900/file_store/checksums/d41d8cd98f00b204e9800998ecf8427e EOM end - # rubocop:enable Style/TrailingWhitespace + # rubocop:enable Layout/TrailingWhitespace it "knife cookbook show x 1.0.0 recipes default.rb shows the default recipe" do knife("cookbook show x 1.0.0 recipes default.rb").should_succeed "file 'n'\n" diff --git a/spec/integration/knife/environment_compare_spec.rb b/spec/integration/knife/environment_compare_spec.rb index 3259b27d1b..720bead8c0 100644 --- a/spec/integration/knife/environment_compare_spec.rb +++ b/spec/integration/knife/environment_compare_spec.rb @@ -42,7 +42,7 @@ describe "knife environment compare", :workstation do } end - # rubocop:disable Style/TrailingWhitespace + # rubocop:disable Layout/TrailingWhitespace it "displays the cookbooks for a single environment" do knife("environment compare x").should_succeed <<EOM x @@ -69,6 +69,6 @@ krad >= 1.0.0 >= 1.0.0 EOM end - # rubocop:enable Style/TrailingWhitespace + # rubocop:enable Layout/TrailingWhitespace end end diff --git a/spec/integration/knife/environment_show_spec.rb b/spec/integration/knife/environment_show_spec.rb index 56422dc1a5..dabdfac6a2 100644 --- a/spec/integration/knife/environment_show_spec.rb +++ b/spec/integration/knife/environment_show_spec.rb @@ -30,7 +30,7 @@ describe "knife environment show", :workstation do } end - # rubocop:disable Style/TrailingWhitespace + # rubocop:disable Layout/TrailingWhitespace it "shows an environment" do knife("environment show b").should_succeed <<EOM chef_type: environment @@ -45,7 +45,7 @@ name: b override_attributes: EOM end - # rubocop:enable Style/TrailingWhitespace + # rubocop:enable Layout/TrailingWhitespace it "shows the requested attribute of an environment" do knife("environment show b -a default_attributes").should_succeed <<EOM diff --git a/spec/integration/knife/role_show_spec.rb b/spec/integration/knife/role_show_spec.rb index df2572447c..f655c03e8d 100644 --- a/spec/integration/knife/role_show_spec.rb +++ b/spec/integration/knife/role_show_spec.rb @@ -31,7 +31,7 @@ describe "knife role show", :workstation do role "cat", {} end - # rubocop:disable Style/TrailingWhitespace + # rubocop:disable Layout/TrailingWhitespace it "shows a cookbook" do knife("role show cons").should_succeed <<EOM chef_type: role @@ -44,7 +44,7 @@ override_attributes: run_list: EOM end - # rubocop:enable Style/TrailingWhitespace + # rubocop:enable Layout/TrailingWhitespace end end diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb index 20bfd37a07..cc2d22f64f 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -85,7 +85,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option it "should combine all the possible options" do combined_opts = [] - supported_useradd_options.sort { |a, b| a[0] <=> b[0] }.each do |attribute, option| + supported_useradd_options.sort_by { |a| a[0] }.each do |attribute, option| allow(@new_resource).to receive(attribute).and_return("hola") combined_opts << option << "hola" end diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb index 929dd00450..ded1bc76f1 100644 --- a/spec/unit/provider/group/groupadd_spec.rb +++ b/spec/unit/provider/group/groupadd_spec.rb @@ -64,7 +64,7 @@ describe Chef::Provider::Group::Groupadd do it "should combine all the possible options" do match_array = [] - field_list.sort { |a, b| a[0] <=> b[0] }.each do |attribute, option| + field_list.sort_by { |a| a[0] }.each do |attribute, option| allow(new_resource).to receive(attribute).and_return("hola") match_array << option match_array << "hola" diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb index 8843de344f..079fd44ef5 100644 --- a/spec/unit/provider/user/pw_spec.rb +++ b/spec/unit/provider/user/pw_spec.rb @@ -69,7 +69,7 @@ describe Chef::Provider::User::Pw do it "should combine all the possible options" do match_array = [ "adam" ] - field_list.sort { |a, b| a[0] <=> b[0] }.each do |attribute, option| + field_list.sort_by { |a| a[0] }.each do |attribute, option| allow(@new_resource).to receive(attribute).and_return("hola") match_array << option match_array << "hola" |