Closed yacn closed 2 years ago
@yacn This fails with this kind of code:
template config_file do
source 'opt/docker-compose/app/athenz/docker-compose.yml'
owner 'root'
group 'root'
mode '0644'
end
I added a spec that will catch that scenario
@tas50 great catch! I originally modified the node matcher pattern to specifically look for an interpolated string but thought it might be more complicated and so used the larger capture (thinking it'd be simpler) thus which introduced the bug you added a test for.
This found 26 new offenses on Supermarket which is more than the previous cop found. Nice improvement
Updates node matcher pattern for
Chef/Modernize/CronDFileOrTempalte
to capture everything in the file/template/cookbook_file resource declaration to catch offenses where the resource name is both a regular string and an interpolated string.Description
The existing matcher does not flag offenses if the
file
/cookbook_file
/template
resource is named using string interpolationRelated Issue
https://github.com/chef/cookstyle/issues/940
Types of changes
Checklist:
since i don't use ruby outside of ChefDK, I need to put together a local dev env to run the tests in; doing so currently and will update the Checklist after I've done so and run the tests on my local machine.This has since been completed.