Closed skippyPeanutButter closed 7 years ago
Previous behavior only allowed yamlbot to check that a particular value for a key was of a specific type. Example: validating that the travis-ci language key value given is a string
yamlbot
string
root_keys: optional: language: accepted_types: - String
This change will allow users to specify a list of values to validate a key against.
Example: validating the travis-ci language key against a list of valid languages.
root_keys: optional: language: values: - 'android' - 'ruby' - 'python' - 'go' - 'java'
This will also give users the ability to validate a key contains any value
Example:
root_keys: optional: language: values: - '*'
Example: check version key contains any integer number
version
root_keys: required: version: accepted_types: - Fixnum values: - '*'
Example: check travis-ci script key contains any string
script
root_keys: required: script: accepted_types: - String values: - '*'
Addresses https://github.com/skippyPeanutButter/yaml_bot/issues/14
I've cut a few issues which I think can help improve how these rules are defined. For now, the changes as-is look good.
Previous behavior only allowed
yamlbot
to check that a particular value for a key was of a specific type. Example: validating that the travis-ci language key value given is astring
This change will allow users to specify a list of values to validate a key against.
Example: validating the travis-ci language key against a list of valid languages.
This will also give users the ability to validate a key contains any value
Example:
Example: check
version
key contains any integer numberExample: check travis-ci
script
key contains any string