Detect using ruby_block to run powershell_out
Open
Nobody has claimed this yet.
New Cop Proposal
Status: Untriaged
- Dominant language
- Ruby
- Stars
- 112
- Forks
- 69
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 13
Description
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:
If there's a powershell command you want to run you should use powershell_script to do it natively instead of wrapping it all in ruby.
What it would trigger on:
ruby_block "foo" do
block do
powershell_out("SomeCmdLet")
end
end
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing ChefCorrectness cops and their tests in Cookstyle, then compare how they detect cookbook patterns. Use the shown ruby_block and powershell_out example as the initial case; done means the new cop identifies this pattern and recommends using powershell_script instead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, ruby
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100