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

env_config: deprecate setting boolean vars to falsy values #18408

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

carlocab
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

The way we handle boolean environment variables is a bit unfortunate.
For example, setting HOMEBREW_EVAL_ALL=false actually enables
HOMEBREW_EVAL_ALL.

Let's fix this by deprecating setting boolean environment variables to
common false-y values (false, 0, nil, no, and off) so that we
can later ignore these false-y values when reading boolean environment
variables.

Note: I haven't commented out odeprecated because I meant to target the PR branch at #18388, but that seems to have merged just before I pushed this.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Great work so far!

Library/Homebrew/env_config.rb Outdated Show resolved Hide resolved
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Perfect, thanks @carlocab!

@carlocab carlocab force-pushed the falsy-env_config branch 2 times, most recently from e5f842f to 4e7037b Compare September 25, 2024 13:03
The way we handle boolean environment variables is a bit unfortunate.
For example, setting `HOMEBREW_EVAL_ALL=false` actually enables
`HOMEBREW_EVAL_ALL`.

Let's fix this by deprecating setting boolean environment variables to
common false-y values (`false`, `0`, `nil`, `no`, and `off`) so that we
can later ignore these false-y values when reading boolean environment
variables.
@carlocab carlocab merged commit 7d23111 into master Sep 25, 2024
27 checks passed
@carlocab carlocab deleted the falsy-env_config branch September 25, 2024 13:28
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