Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry system for documentation and validation of YAML fields #16

Open
malcolmbarrett opened this issue Jun 24, 2019 · 1 comment
Open
Labels
feature a feature request or enhancement

Comments

@malcolmbarrett
Copy link
Collaborator

malcolmbarrett commented Jun 24, 2019

Packages could use this to formally specify and document their YAML fields, e.g.

register_toplevel_yaml(data.frame(field = "type", validate = pkg::is_function(), doc = "This is what this does"))

Save to an environment yamlthis checks for somehow?

@malcolmbarrett malcolmbarrett added the feature a feature request or enhancement label Jun 25, 2019
@malcolmbarrett
Copy link
Collaborator Author

malcolmbarrett commented Jun 25, 2019

This needs to marinate, but here are a few thoughts after discussing with @rich-iannone:

  • maybe should be a separate package (something lightweight)
  • maybe have packages write this as YAML, e.g.
pkg: pkgname
x:
  y: 
    z: []
    yml_validate: is.numeric
    yml_desc: this is what z is 
    yml_validate_order: true # check that z is after y is after x
  • if using this approach, have some syntax? e.g. yml_validate: ~ is.numeric(.x) && ~length(.x) == 1
  • how to store and retrieve?
  • A completely different approach is to have helper functions to create function factories for packages in the format ymlthis_pkgname() that’s has internal validation etc.

@malcolmbarrett malcolmbarrett changed the title Registry system for YAML fields Registry system for documentation and validation of YAML fields Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant