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

Standardize boolean values and update .env file pattern #1392

Merged

Conversation

hcaumo
Copy link

@hcaumo hcaumo commented Dec 23, 2024

Replace YES/NO with true/false for boolean variables in .env file. Ensure consistency across the codebase by removing the need for parseBooleanFromText.
Relates to:

#1391 - Standardize boolean values and fix pattern for .env file

Background
What does this PR do?

This PR replaces the "YES" and "NO" values used in the .env file for boolean variables with true and false to ensure consistency across the codebase. It removes the need for the parseBooleanFromText function, simplifying the parsing logic.
What kind of change is this?

Testing
Where should a reviewer start?

The reviewer should begin by checking the .env file to ensure that all boolean variables are now using true or false instead of "YES" or "NO".
Detailed testing steps

Check the .env file and verify that all boolean variables (e.g., POST_IMMEDIATELY, TWITTER_SEARCH_ENABLE) now use true or false.
Ensure that no usage of parseBooleanFromText exists in the codebase anymore.
Test the functionality where these variables are used to ensure they work correctly as booleans.

Replace YES/NO with true/false for boolean variables in .env file.
Ensure consistency across the codebase by removing the need for parseBooleanFromText.
monilpat
monilpat previously approved these changes Dec 23, 2024
@monilpat monilpat changed the base branch from main to develop December 23, 2024 17:22
@monilpat monilpat dismissed their stale review December 23, 2024 17:22

The base branch was changed.

@monilpat monilpat merged commit aa2f4bf into elizaOS:develop Dec 23, 2024
2 checks passed
this.runtime.getSetting("POST_IMMEDIATELY")
);
// Retrieve setting, default to false if not set or if the value is not "true"
postImmediately = this.runtime.getSetting("POST_IMMEDIATELY") === "true" || false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about if they use TRUE or yes or YES? parseBooleanFromText looks for yes/no.

falsish needs to be move into core/packages/parsers.ts

function isFalsish(input: any): boolean {

And that's probably what we should be using

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.

3 participants