flemay / envvars

Give your environment variables the love they deserve.
MIT License
20 stars 4 forks source link

Print variable description on "envvar ensure" failure #7

Closed aarongorka closed 2 years ago

aarongorka commented 3 years ago

If you're not already familiar with envvars, it's probably not intuitive to go looking in envvars.yml when you get an error about unset variables. The description for the variable will be really useful if you need to set it, so an easy way to surface this information is in the error from envvar ensure.

flemay commented 2 years ago

Hi @aarongorka !

Currently the output looks like the following:

environment variable ENVVAR_1 is not defined
environment variable ENVVAR_2 is empty
environment variable ENVVAR_3 is not defined

How would you like the output with description to be? :) Also, what about a very long description?

aarongorka commented 2 years ago

How would you like the output with description to be?

I wasn't thinking of anything particularly fancy, something like this would be useful:

environment variable ENVVAR_1 is not defined. Variable description: ${desc}
environment variable ENVVAR_2 is empty. Variable description: ${desc}
environment variable ENVVAR_3 is not defined  # no description defined in envvars.yml

Also, what about a very long description?

I don't see any problems with long descriptions

flemay commented 2 years ago

@aarongorka You can review the PR if you want :)