Skip to content

Conversation

@cidrblock
Copy link
Contributor

This PR replaces all calls to the to_bool function with the existing boolean function for consistency.

Changes:

  • Replace to_bool function calls with boolean function calls in config.py and ansi_output.py
  • Add optional default parameter to boolean function to return fallback value for invalid inputs
  • Apply default parameter to environment variable parsing to prevent TypeError exceptions
  • Move boolean function tests from test_ansi_output.py to test_util.py for proper organization
  • Add comprehensive test coverage for the new default parameter functionality
  • Update type annotations and add proper docstring documentation

The boolean function now accepts a default parameter that provides graceful fallback for invalid environment variable values while maintaining strict behavior when no default is specified.

- Replace all to_bool function calls with boolean function calls
- Add default parameter to boolean function for graceful fallback
- Apply default parameter to environment variable parsing to prevent crashes
- Move boolean function tests from test_ansi_output.py to test_util.py
- Add comprehensive test coverage for default parameter functionality
- Fix type annotations and docstring documentation
@cidrblock cidrblock merged commit ecff4c0 into main Aug 20, 2025
23 of 24 checks passed
@cidrblock cidrblock deleted the two_times_bool branch August 20, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants