cookstyle
cookstyle copied to clipboard
Check for template resources in custom resources that don't set the cookbook property
What category of cop is this?:
Please try to select as few as possible.
- [ ] Deprecation - A cop that alerts to a deprecation in the Chef Infra Client
- [ ] Correctness - A cop that alerts when incorrect coding behavior is being used
- [ ] Sharing - A cop that alerts to missing functionality necessary for sharing cookboooks with others
- [ ] Style - A cop that alerts to a style best practice
- [ ] Simplification - A cop that alerts to ways code can be simplified through refactoring
- [ ] Effortless - A cop that alerts on code that must be resolved to move to the Effortless pattern
- [ ] Policyfiles - A cop that alerts on code that must be resolved to move to the Policyfiles pattern
Describe the new cop:
If you use a template resource in a custom resource, but don't set the cookbook property then the template resource will look in the cookbook calling the resource instead of the cookbook containing the resource. For most users it's desirable to look in the cookbook containing the resource so we should alert if we find the template in resource's cookbook and it's not wired up this way.