summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-07 15:19:21 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-07 15:19:21 -0700
commit1485a862053fb20ade1f93bb82c6918cd4078975 (patch)
tree21ae9d81524f56a4b52449424550259422b1b9a5 /lib/chef/cookbook
parent3e9e6d41a31bd1ac932f7f4100102466b4fdfe05 (diff)
downloadchef-1485a862053fb20ade1f93bb82c6918cd4078975.tar.gz
Avoid assigning variables before returning if we don't have to
These seemed pretty straight forward. There's a new Rubocop cop for these. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r--lib/chef/cookbook/remote_file_vendor.rb4
-rw-r--r--lib/chef/cookbook/syntax_check.rb3
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/chef/cookbook/remote_file_vendor.rb b/lib/chef/cookbook/remote_file_vendor.rb
index e2a9798c8a..a6a6e96e06 100644
--- a/lib/chef/cookbook/remote_file_vendor.rb
+++ b/lib/chef/cookbook/remote_file_vendor.rb
@@ -72,10 +72,8 @@ class Chef
Chef::Log.trace("Current checksum: #{current_checksum}; manifest checksum: #{found_manifest_record["checksum"]})")
end
- full_path_cache_filename = Chef::FileCache.load(cache_filename, false)
-
# return the filename, not the contents (second argument= false)
- full_path_cache_filename
+ Chef::FileCache.load(cache_filename, false)
end
def validate_cached_copy(cache_filename)
diff --git a/lib/chef/cookbook/syntax_check.rb b/lib/chef/cookbook/syntax_check.rb
index a654103a53..8b593eea81 100644
--- a/lib/chef/cookbook/syntax_check.rb
+++ b/lib/chef/cookbook/syntax_check.rb
@@ -120,8 +120,7 @@ class Chef
path = Chef::Util::PathHelper.escape_glob_dir(cookbook_path)
files = Dir[File.join(path, "**", "*.rb")]
files = remove_ignored_files(files)
- files = remove_uninteresting_ruby_files(files)
- files
+ remove_uninteresting_ruby_files(files)
end
def untested_ruby_files