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

Adds sherpa.ResolveBool for use in helpers #91

Merged
merged 1 commit into from
Oct 6, 2021
Merged

Adds sherpa.ResolveBool for use in helpers #91

merged 1 commit into from
Oct 6, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Oct 6, 2021

Summary

Provide the method with an env variable name and it will resolve & attempt to validate in a consistent way if the variable is true or false.

The function returns true for 1, t, T, TRUE, true, True. It returns false for all other values (even invalid) and if the variable is not set.

Use Cases

For use in cases where ConfigurationResolver isn't appropriate, like in helpers.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

Provide the method with an env variable name and it will resolve & attempt to validate in a consistent way if the variable is true or false.

The function returns true for 1, t, T, TRUE, true, True. It returns false for all other values (even invalid) and if the variable is not set.

Signed-off-by: Daniel Mikusa <[email protected]>
@dmikusa dmikusa added type:enhancement A general enhancement semver:minor A change requiring a minor version bump labels Oct 6, 2021
@dmikusa dmikusa requested a review from a team October 6, 2021 16:13
@pivotal-david-osullivan
Copy link
Contributor

👍

@dmikusa dmikusa merged commit 5bedaab into main Oct 6, 2021
@dmikusa dmikusa deleted the resolve-env branch October 6, 2021 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants