Class: RuboCop::Cop::Chef::Modernize::ResourceForcingCompileTime
- Defined in:
- lib/rubocop/cop/chef/modernize/compile_time_resources.rb
Overview
The hostname, build_essential, chef_gem, and ohai_hint resources include ‘compile_time’ properties, which should be used to force the resources to run at compile time by setting ‘compile_time true`.
Constant Summary collapse
- MSG =
"Set 'compile_time true' in resources when available instead of forcing resources to run at compile time by setting an action on the block."
- RESTRICT_ON_SEND =
[:run_action].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
44 45 46 47 48 |
# File 'lib/rubocop/cop/chef/modernize/compile_time_resources.rb', line 44 def on_send(node) compile_time_resource?(node) do add_offense(node, severity: :refactor) end end |