cookstyle icon indicating copy to clipboard operation
cookstyle copied to clipboard

Detect using run_action on the resource block to force compile_time

Open tas50 opened this issue 4 years ago • 0 comments

When someone does this

    file tokenpath do
      owner   new_resource.owner
      group   new_resource.group
      mode    '644'
      content authz.file_content
      action  :nothing
    end.run_action(:create)

We should autocorrect to:

    file tokenpath do
      owner   new_resource.owner
      group   new_resource.group
      mode    '644'
      content authz.file_content
      action  :create
      compile_time true
    end
  1. Update action with action from run_action method
  2. Remove run_action method call
  3. Add compile_time true

This would be a modernize cop that requires 16.0

tas50 avatar Sep 02 '21 02:09 tas50