Chef/Modernize/CronDFileOrTemplate triggers on cron.daily #954
Labels
False Positive
Cop has false positives (errors for no reason)
Status: Good First Issue
An issue ready for a new contributor.
Triage: Confirmed
Indicates and issue has been confirmed as described.
Type: Bug
Does not work as expected.
Version:
Chef Workstation 22.2.807
Cookstyle 7.32.0
Environment:
Debian 11
Scenario:
We use a cookbook_file resource to process a file in /etc/cron.daily
Steps to Reproduce:
Add the following resource to a cookbook recipe:
Then run cookstyle
Expected Result:
I expect no warning from this.
Actual Result:
Chef/Modernize/CronDFileOrTemplate: Use the cron_d resource that ships with Chef Infra Client 14.4+ instead of manually creating the file with template, file, or cookbook_file resources (https://docs.chef.io/workstation/cookstyle/chef_modernize_crondfileortemplate) cookbook_file '/etc/cron.daily/locate' do ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I am guessing that the cop is triggering on cron.d*, instead of just cron.d
#946 seems to have a very similar issue
FYI: cron.daily is a directory where scripts can be dropped that run daily, cron.d is a directory where cron jobs with full cron configuration (i.e.: with time, user, etc) are placed.
The text was updated successfully, but these errors were encountered: