-
Notifications
You must be signed in to change notification settings - Fork 330
DRY/Refactor hard coded config file keys #1646
Copy link
Copy link
Open
Labels
good first issueSmall, contained changes that are good for newcomersSmall, contained changes that are good for newcomers
Description
The motivation of this issue is to prevent bugs like #1645.
The Config object uses various keys for storing configuration properties. Currently many of those get populated during argument parsing (e.g.
Lines 1024 to 1029 in 4c7141a
| cfg.add(config.Scope.applicationOverride, "system", "list.config.option", args.configuration) | |
| cfg.add(config.Scope.applicationOverride, "system", "list.max_results", args.limit) | |
| cfg.add(config.Scope.applicationOverride, "system", "admin.track", args.track) | |
| cfg.add(config.Scope.applicationOverride, "system", "list.races.benchmark_name", args.benchmark_name) | |
| cfg.add(config.Scope.applicationOverride, "system", "list.from_date", args.from_date) | |
| cfg.add(config.Scope.applicationOverride, "system", "list.races.to_date", args.to_date) |
This approach is brittle and error prone. We should DRY things up and instead reference the config options via meaningful variable names in some module (e.g. config.py) such that a typo becomes a real error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueSmall, contained changes that are good for newcomersSmall, contained changes that are good for newcomers
Type
Fields
Give feedbackNo fields configured for issues without a type.