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

Return None for empty optional plugin config fields #3219

Merged

Conversation

chrisnovakovic
Copy link
Contributor

Specifying an empty value for an optional plugin configuration field causes the field to be set to the type's default value ("" for strings, 0 for integers, False for booleans) from the perspective of ASP. This makes it impossible to tell whether an optional field was actually assigned a value inside a BUILD file.

For optional fields, return None if no value is assigned.

Specifying an empty value for an optional plugin configuration field
causes the field to be set to the type's default value (`""` for
strings, `0` for integers, `False` for booleans) from the perspective of
ASP. This makes it impossible to tell whether an optional field was
actually assigned a value inside a `BUILD` file.

For optional fields, return `None` if no value is assigned.
Copy link
Member

@peterebden peterebden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems legit to me. I guess it could technically be breaking if someone was previously explicitly checking for False, but it'd pretty much have to be if CONFIG.THING is False: which seems like it wouldn't be common

@chrisnovakovic chrisnovakovic merged commit 7e2801a into thought-machine:master Aug 13, 2024
14 checks passed
@chrisnovakovic chrisnovakovic deleted the plugin-config-empty-none branch August 13, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants