Rename environment.get_value_string()
to get_value_raw()
.
#4132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a prelude to fixing type errors in
environment.py
.One of the big sources of type errors so far has been the fact that
environment.get_value()
is ~untyped. Many places in the codebase assume that it returns e.g. a string, or an int. We can introduceget_value_int()
for example for ints that checks at runtime that the environment variable evaluated to an int, and use that instead where applicable to appease thetype checker (and surface errors earlier at runtime).
There is a need for a
get_value_string()
that tries to evaluate environment variable contents, i.e. supports quoted values. Many variables are expected to be strings, yet the pervasive use ofenvironment.get_value()
andenvironment.set_value()
means it is hard to tell whether they are sometimes quoted or not.This PR renames the current
get_value_string()
function to make space for a futureget_value_string()
that evaluates variables.