summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-12-25 19:59:45 -0800
committerTim Smith <tsmith84@gmail.com>2020-12-25 20:37:21 -0800
commit1c48a7b9c73e39dc49b03e8196661d1c82f05ac5 (patch)
tree3d5f1d2e7be47d0834117a37f2ed506685475f7e
parent07d00d7bc07ccdca7f34abf5bb05ef2d77ebb8dc (diff)
downloadchef-1c48a7b9c73e39dc49b03e8196661d1c82f05ac5.tar.gz
Resolve Lint/ParenthesesAsGroupedExpression warningsLint_ParenthesesAsGroupedExpression
Get some consistency here Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.rubocop.yml2
-rw-r--r--chef-config/spec/unit/config_spec.rb2
-rw-r--r--chef-config/spec/unit/path_helper_spec.rb6
-rw-r--r--lib/chef/chef_fs/file_system.rb2
-rw-r--r--lib/chef/provider.rb2
-rw-r--r--spec/functional/dsl/registry_helper_spec.rb2
-rw-r--r--spec/functional/resource/registry_spec.rb16
-rw-r--r--spec/functional/win32/registry_spec.rb2
-rw-r--r--spec/integration/recipes/recipe_dsl_spec.rb18
-rw-r--r--spec/unit/application/solo_spec.rb2
-rw-r--r--spec/unit/dsl/registry_helper_spec.rb2
-rw-r--r--spec/unit/knife/bootstrap_spec.rb2
-rw-r--r--spec/unit/provider/subversion_spec.rb4
-rw-r--r--spec/unit/resource/windows_task_spec.rb2
-rw-r--r--spec/unit/user_spec.rb2
-rw-r--r--spec/unit/user_v1_spec.rb4
16 files changed, 34 insertions, 36 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 0270949244..ebee4a6e41 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -12,8 +12,6 @@ Lint/UselessAssignment:
Enabled: false
Lint/DeprecatedClassMethods:
Enabled: false
-Lint/ParenthesesAsGroupedExpression:
- Enabled: false
Lint/AmbiguousRegexpLiteral:
Enabled: false
Lint/AssignmentInCondition:
diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb
index 3d7365927d..658acca615 100644
--- a/chef-config/spec/unit/config_spec.rb
+++ b/chef-config/spec/unit/config_spec.rb
@@ -225,7 +225,7 @@ RSpec.describe ChefConfig::Config do
end
describe "#var_chef_path" do
- let (:dirname) { ChefUtils::Dist::Infra::DIR_SUFFIX }
+ let(:dirname) { ChefUtils::Dist::Infra::DIR_SUFFIX }
context "on unix", :unix_only do
it "var_chef_dir is /var/chef" do
diff --git a/chef-config/spec/unit/path_helper_spec.rb b/chef-config/spec/unit/path_helper_spec.rb
index 3eedb8bbf5..5721e105ec 100644
--- a/chef-config/spec/unit/path_helper_spec.rb
+++ b/chef-config/spec/unit/path_helper_spec.rb
@@ -355,14 +355,14 @@ RSpec.describe ChefConfig::PathHelper do
end
context "on windows" do
- let (:is_windows) { true }
+ let(:is_windows) { true }
end
context "on unix" do
- let (:is_windows) { false }
+ let(:is_windows) { false }
context "when HOME is not set" do
- let (:env) { {} }
+ let(:env) { {} }
it "returns an empty array" do
expect(path_helper.all_homes).to eq([])
end
diff --git a/lib/chef/chef_fs/file_system.rb b/lib/chef/chef_fs/file_system.rb
index aadfc9807c..73c3f0090a 100644
--- a/lib/chef/chef_fs/file_system.rb
+++ b/lib/chef/chef_fs/file_system.rb
@@ -292,7 +292,7 @@ class Chef
end
end
else
- ui.output ("Not deleting extra entry #{dest_path} (purge is off)") if ui
+ ui.output("Not deleting extra entry #{dest_path} (purge is off)") if ui
end
end
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 4d5631397b..81ed530fc7 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -435,7 +435,7 @@ class Chef
# this block cannot interact with resources outside, e.g.,
# manipulating notifies.
- converge_by ("evaluate block and run any associated actions") do
+ converge_by("evaluate block and run any associated actions") do
saved_run_context = run_context
begin
@run_context = run_context.create_child
diff --git a/spec/functional/dsl/registry_helper_spec.rb b/spec/functional/dsl/registry_helper_spec.rb
index a36114eb3a..9d043dd35f 100644
--- a/spec/functional/dsl/registry_helper_spec.rb
+++ b/spec/functional/dsl/registry_helper_spec.rb
@@ -21,7 +21,7 @@ require "spec_helper"
describe Chef::Resource::RegistryKey, :windows_only do
- before (:all) do
+ before(:all) do
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root"
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Branch"
::Win32::Registry::HKEY_CURRENT_USER.open('Software\\Root', Win32::Registry::KEY_ALL_ACCESS) do |reg|
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb
index aa7e12b3cb..f3ad946f0e 100644
--- a/spec/functional/resource/registry_spec.rb
+++ b/spec/functional/resource/registry_spec.rb
@@ -127,12 +127,12 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
@new_resource.cookbook_version(@cookbook_version)
end
- after (:all) do
+ after(:all) do
clean_registry
end
context "when action is create" do
- before (:all) do
+ before(:all) do
reset_registry
end
it "creates registry key, value if the key is missing" do
@@ -290,7 +290,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
end
context "while running in whyrun mode" do
- before (:each) do
+ before(:each) do
Chef::Config[:why_run] = true
end
@@ -342,7 +342,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
end
context "when action is create_if_missing" do
- before (:all) do
+ before(:all) do
reset_registry
end
@@ -454,7 +454,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
end
context "while running in whyrun mode" do
- before (:each) do
+ before(:each) do
Chef::Config[:why_run] = true
end
@@ -576,7 +576,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
end
context "while running in whyrun mode" do
- before (:each) do
+ before(:each) do
Chef::Config[:why_run] = true
end
it "does nothing if the action is delete" do
@@ -591,7 +591,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
end
context "when the action is delete_key" do
- before (:all) do
+ before(:all) do
reset_registry
create_deletable_keys
end
@@ -653,7 +653,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do
expect(@report["total_res_count"]).to eq("1")
end
context "while running in whyrun mode" do
- before (:each) do
+ before(:each) do
Chef::Config[:why_run] = true
end
diff --git a/spec/functional/win32/registry_spec.rb b/spec/functional/win32/registry_spec.rb
index 3a1c71edf1..2b371ee9ed 100644
--- a/spec/functional/win32/registry_spec.rb
+++ b/spec/functional/win32/registry_spec.rb
@@ -322,7 +322,7 @@ describe "Chef::Win32::Registry", :windows_only do
end
describe "delete_key" do
- before (:all) do
+ before(:all) do
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Branch\\Fruit"
::Win32::Registry::HKEY_CURRENT_USER.open('Software\\Root\\Branch\\Fruit', Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg["Apple", Win32::Registry::REG_MULTI_SZ] = %w{Red Juicy}
diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb
index e714465a17..c692915afd 100644
--- a/spec/integration/recipes/recipe_dsl_spec.rb
+++ b/spec/integration/recipes/recipe_dsl_spec.rb
@@ -204,7 +204,7 @@ describe "Recipe DSL methods" do
another_no_name_thingy3("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy3)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy3)
end
end
@@ -234,7 +234,7 @@ describe "Recipe DSL methods" do
another_no_name_thingy4("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy4)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy4)
end
it "and platform_family = foo, another_no_name_thingy4 works" do
@@ -244,7 +244,7 @@ describe "Recipe DSL methods" do
another_no_name_thingy4("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy4)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy4)
end
end
@@ -273,7 +273,7 @@ describe "Recipe DSL methods" do
another_no_name_thingy5("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy5)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy5)
end
it "the new resource name can be used in a recipe" do
@@ -281,7 +281,7 @@ describe "Recipe DSL methods" do
another_thingy_name_for_another_no_name_thingy5("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy5)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy5)
end
end
@@ -310,7 +310,7 @@ describe "Recipe DSL methods" do
another_no_name_thingy6("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy6)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy6)
end
it "the new resource name can be used in a recipe" do
@@ -318,7 +318,7 @@ describe "Recipe DSL methods" do
another_thingy_name_for_another_no_name_thingy6("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy6)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy6)
end
end
@@ -339,7 +339,7 @@ describe "Recipe DSL methods" do
another_thingy_name_for_another_no_name_thingy7("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy7)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy7)
end
it "and os = blarghle, another_thingy_name_for_another_no_name_thingy7 works" do
@@ -349,7 +349,7 @@ describe "Recipe DSL methods" do
another_thingy_name_for_another_no_name_thingy7("blah") {}
end
expect(recipe.logged_warnings).to eq ""
- expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy7)
+ expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy7)
end
it "the old resource name does not work" do
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index 0824f8b5b3..f9302a0bb2 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -202,7 +202,7 @@ describe Chef::Application::Solo do
expect(Chef::Config).to receive(:find_chef_repo_path).and_return(root_path)
app.reconfigure
expect(Chef::Config.key?(:chef_repo_path)).to be_truthy
- expect(Chef::Config[:chef_repo_path]).to eq (root_path)
+ expect(Chef::Config[:chef_repo_path]).to eq(root_path)
end
it "runs chef-client in local mode" do
diff --git a/spec/unit/dsl/registry_helper_spec.rb b/spec/unit/dsl/registry_helper_spec.rb
index 34a8c02039..5ef8caa053 100644
--- a/spec/unit/dsl/registry_helper_spec.rb
+++ b/spec/unit/dsl/registry_helper_spec.rb
@@ -21,7 +21,7 @@ require "spec_helper"
describe Chef::Resource::RegistryKey do
- before (:all) do
+ before(:all) do
events = Chef::EventDispatch::Dispatcher.new
node = Chef::Node.new
node.consume_external_attrs(OHAI_SYSTEM.data, {})
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 3797207b6d..64a59f2ddb 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -320,7 +320,7 @@ describe Chef::Knife::Bootstrap do
context "with bootstrap_attribute options" do
let(:jsonfile) do
- file = Tempfile.new (["node", ".json"])
+ file = Tempfile.new(["node", ".json"])
File.open(file.path, "w") { |f| f.puts '{"foo":{"bar":"baz"}}' }
file
end
diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb
index f249f564b1..0ce9a19ec2 100644
--- a/spec/unit/provider/subversion_spec.rb
+++ b/spec/unit/provider/subversion_spec.rb
@@ -319,11 +319,11 @@ describe Chef::Provider::Subversion do
let(:http_proxy_uri) { "http://somehost:1" }
let(:http_no_proxy) { "svn.example.org" }
- before (:all) do
+ before(:all) do
@original_env = ENV.to_hash
end
- after (:all) do
+ after(:all) do
ENV.clear
ENV.update(@original_env)
end
diff --git a/spec/unit/resource/windows_task_spec.rb b/spec/unit/resource/windows_task_spec.rb
index c39dcde115..b991cb89de 100644
--- a/spec/unit/resource/windows_task_spec.rb
+++ b/spec/unit/resource/windows_task_spec.rb
@@ -218,7 +218,7 @@ describe Chef::Resource::WindowsTask, :windows_only do
end
it "raise error when priority value less than 0" do
- expect { resource.priority (-1) }.to raise_error(Chef::Exceptions::ValidationFailed, "Option priority's value -1 should be in range of 0 to 10!")
+ expect { resource.priority(-1) }.to raise_error(Chef::Exceptions::ValidationFailed, "Option priority's value -1 should be in range of 0 to 10!")
end
it "raise error when priority values is greater than 10" do
diff --git a/spec/unit/user_spec.rb b/spec/unit/user_spec.rb
index 24c24f2b78..a52272799c 100644
--- a/spec/unit/user_spec.rb
+++ b/spec/unit/user_spec.rb
@@ -201,7 +201,7 @@ describe Chef::User do
end
describe "API Interactions" do
- before (:each) do
+ before(:each) do
@user = Chef::User.new
@user.name "foobar"
@http_client = double("Chef::ServerAPI mock")
diff --git a/spec/unit/user_v1_spec.rb b/spec/unit/user_v1_spec.rb
index b4b41d832e..17bd4f3094 100644
--- a/spec/unit/user_v1_spec.rb
+++ b/spec/unit/user_v1_spec.rb
@@ -314,7 +314,7 @@ describe Chef::UserV1 do
let(:response_406) { OpenStruct.new(code: "406") }
let(:exception_406) { Net::HTTPClientException.new("406 Not Acceptable", response_406) }
- before (:each) do
+ before(:each) do
@user = Chef::UserV1.new
allow(@user).to receive(:chef_root_rest_v0).and_return(double("chef rest root v0 object"))
allow(@user).to receive(:chef_root_rest_v1).and_return(double("chef rest root v1 object"))
@@ -535,7 +535,7 @@ describe Chef::UserV1 do
end # Versioned API Interactions
describe "API Interactions" do
- before (:each) do
+ before(:each) do
@user = Chef::UserV1.new
@user.username "foobar"
@http_client = double("Chef::ServerAPI mock")