Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
Eliminates redundant constants.py file by moving all constants to config.py.
All constants (except baseball positions) are now accessible via get_config().
Changes:
- config.py: Added baseball position sets as module-level constants
* PITCHER_POSITIONS, POSITION_FIELDERS, ALL_POSITIONS remain static
* All other constants now accessed via BotConfig instance
- constants.py: Deleted (redundant with config.py)
- Updated 27 files to use get_config() instead of constants module:
* Commands: admin, help, league (3), players, profile, teams (3),
transactions (3), utilities, voice
* Services: league, player, team, trade_builder, transaction_builder
* Utils: autocomplete, team_utils
* Views: embeds
* Tests: test_constants, test_services (3 files)
* Examples: enhanced_player, migration_example
- tests/test_constants.py: Rewritten to test config values
* All 14 tests pass
* Now validates BotConfig defaults instead of constants module
Import Changes:
- Old: `from constants import SBA_CURRENT_SEASON`
- New: `from config import get_config` → `get_config().sba_current_season`
- Positions: `from config import PITCHER_POSITIONS, ALL_POSITIONS`
Benefits:
- Single source of truth (config.py only)
- Cleaner architecture - no redundant wrapper
- All constants configurable via environment variables
- Reduced maintenance overhead
- Type safety with Pydantic validation
All configuration tests pass. Core refactoring complete.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|---|---|---|
| .vscode | ||
| api | ||
| commands | ||
| models | ||
| services | ||
| tasks | ||
| tests | ||
| utils | ||
| views | ||
| .dockerignore | ||
| .gitignore | ||
| bot.py | ||
| BUILD_AND_PUSH.md | ||
| build-and-push.sh | ||
| COMMAND_LIST.md | ||
| config.py | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| DOCKER.md | ||
| Dockerfile | ||
| exceptions.py | ||
| PRE_LAUNCH_ROADMAP.md | ||
| pyrightconfig.json | ||
| requirements.txt | ||
| test_real_data.py | ||