cookstyle icon indicating copy to clipboard operation
cookstyle copied to clipboard

Detect multiple uses of provides with the same name

Open tas50 opened this issue 4 years ago • 0 comments

What category of cop is this?:

Please try to select as few as possible.

  • [ ] ChefDeprecations - A cop that alerts on a deprecation in the Chef Infra Client
  • [ ] ChefCorrectness - A cop that alerts when incorrect coding behavior is being used
  • [ ] ChefSharing - A cop that alerts to missing functionality necessary for sharing cookbooks with others
  • [ ] ChefStyle - A cop that alerts to a style best practice
  • [ ] ChefModernize - A cop that alerts when a cookbook can be simplified or modernized with new functionality
  • [ ] ChefEffortless - A cop that alerts on code that must be resolved to move to the Effortless pattern

Describe the new cop:

There's no reason to use provides with the same name more than once and it doesn't do what you think it does. I suspect the last one wins, but it doesn't make sense regardless.

What it would trigger on:

provides :automatic_software_updates
provides :automatic_software_updates, platform: 'mac_os_x'

tas50 avatar Jun 06 '20 02:06 tas50