Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve chefstyle warnings #363

Merged
merged 1 commit into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/chef-vault
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ options_config.each do |option, config|
end

options_config.each do |option, config|
options[option] = options[option] ? options[option] : config[:default]
options[option] = options[option] || config[:default]
end

require "rubygems" unless defined?(Gem)
Expand Down
2 changes: 1 addition & 1 deletion chef-vault.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$:.push File.expand_path("../lib", __FILE__)
$:.push File.expand_path("lib", __dir__)
require "chef-vault/version"

Gem::Specification.new do |s|
Expand Down
4 changes: 2 additions & 2 deletions lib/chef/knife/mixin/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def values_from_json(json)
# Raises `InvalidValue` if any of the json's values contain non-printable characters.
def validate_json(json)
begin
evaled_json = eval(json)
rescue SyntaxError => e
evaled_json = eval(json) # rubocop: disable Security/Eval
rescue SyntaxError
raise ChefVault::Exceptions::InvalidValue, "#{json} is not valid JSON!"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/vault_admins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def admins
vault_admins = Chef::Config[:knife][:vault_admins]
admin_array = [Chef::Config[:node_name]]

if !vault_admins.kind_of?(Array)
unless vault_admins.is_a?(Array)
ui.warn("Vault admin must be an array")
end

Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/vault_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.included(includer)
includer.class_eval do
deps do
require "chef/search/query"
require File.expand_path("../mixin/helper", __FILE__)
require File.expand_path("mixin/helper", __dir__)
include ChefVault::Mixin::Helper
end

Expand Down