skippyPeanutButter / yaml_bot

Validate the content of a yaml file according to a set of rules
MIT License
3 stars 0 forks source link

Validate specific values in addition to their types #14

Closed skippyPeanutButter closed 7 years ago

skippyPeanutButter commented 7 years ago

Currently, yamlbot will only validate that the datatype of a value is allowed for a specific key.

language: some_language

The current behavior of yamlbot is to check that some_language is of type string.

It would be ideal to be able to validate that specific values for different keys are correct. Building upon the previous example.

language: some_language

This new behavior should check that some_language is a valid value by checking it against a list of approved languages. If the language is not in the list, consider it a violation and print out a message listing the approved values. This new behavior could possibly be triggered by using a new key specific_values, as opposed to the accepted_types key.