chef / chef/cookstyle

Provide basic validation of default values in resource properties

Open
#97 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

New Cop Proposal
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.

  • 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 someone sets a Hash or Array we should make sure those are allowed types for the propety

What it would trigger on:
property :my_property, [ String ], default: []
What it would autocorrect to if applicable

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing correctness cops and the resource-property handling in Cookstyle; no source file or test is named in the issue. Use the example with a String property and an Array default as the starting case, and consider the work done when an incompatible default is reported while an allowed default is accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.