chef / cookstyle

A linting tool that helps you to write better Chef Infra cookbooks and InSpec profiles by detecting and automatically correcting style, syntax, and logic mistakes in your code.
Apache License 2.0
107 stars 54 forks source link

Chef/Modernize/CronDFileOrTemplate fails to flag matching resources that use string interpolation #940

Closed yacn closed 2 years ago

yacn commented 2 years ago

Version:

7.25.10

Environment:

Scenario:

Chef/Modernize/CronDFileOrTemplate should fire in all cases it's relevant.

Steps to Reproduce:

create a minimal cookbook with the following recipe and run cookstyle.

job = 'fizz'
file "/etc/cron.d/#{job}" do
  action :delete
end

Expected Result:

An offense for Chef/Modernize/CronDFileOrTemplate should be raised but is not.

Actual Result:

cookstyle reports no offenses detected

[isaacboehman@fedora tst-cb]$ cookstyle
Inspecting 2 files
..

2 files inspected, no offenses detected
yacn commented 2 years ago

fixed in #941