lib/rubocop/cop/chef/effortless/node_environment.rb in cookstyle-6.11.4 vs lib/rubocop/cop/chef/effortless/node_environment.rb in cookstyle-6.12.6

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith (<tsmith@chef.io>) # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,10 +26,10 @@ # # bad # node.environment == "production" # node.chef_environment == "production" # class CookbookUsesEnvironmments < Cop - MSG = 'Cookbook uses environments, which cannot be used in Policyfiles or Effortless Infra'.freeze + MSG = 'Cookbook uses environments, which cannot be used in Policyfiles or Effortless Infra' def on_send(node) if %i(environment chef_environment).include?(node.method_name) && node.receiver && node.receiver.send_type? && node.receiver.method_name == :node add_offense(node, location: :expression, message: MSG, severity: :refactor) end