Default configuration options should be empty strings for boolean toggles
- Dominant language
- Python
- Stars
- 7
- Forks
- 10
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 5
Description
# ✨ Feature Request
We currently use `None` as the default for all configuration options. Since this can't be specified in a configuration file, it makes sense to use `None` in most cases as it means the user definitely hasn't specified a value.
For the boolean toggles though (e.g. whether logging is enabled), it makes more sense for the default to be an empty string. This enables us to use e.g.:
`if CONFIG['ants_logging']['enabled'].lower() == 'true':
`
without needing to handle the case where `CONFIG['ants_logging']['enabled']` is `None`.
An alternative approach would be to expand our configuration parser to store actual Booleans, rather than strings, in the config dictionary.
Note this may be made obsolete with ongoing work to restructure how we do application configuration.
Contributor guide
Research direction
Start by locating the application configuration parser and the CONFIG['ants_logging']['enabled'] entry point, then inspect how defaults are assigned for boolean toggles. Check the ongoing configuration restructuring before choosing an approach. Done means boolean toggle defaults can be read with .lower() without handling None, or the restructuring explicitly supersedes this request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100