Git Workflow Instructions
When performing a commit or preparing a push, follow these project-specific rules:
- •
Pre-Commit Verification:
- •Backend: Run
ruff check backend/for linting andpytest backend/for tests. - •If frontend changes were made: Run
npm run lintandnpm testin thewebdirectory. - •This prevents merging broken code to main.
- •Backend: Run
- •
Commit Message Format:
- •Use descriptive headers with format:
<type>(<scope>): <description> - •Types:
feat,fix,docs,refactor,test,chore - •Scope: affected component (e.g.,
backend/tasks,web/components) - •Examples:
- •✅
feat(backend/tasks): add retry logic for failed macro jobs - •❌
fix stuff(too vague)
- •✅
- •For breaking changes or multi-line details, add a body with issue references (e.g.,
Closes #123)
- •Use descriptive headers with format:
- •
Breaking Changes:
- •Mark breaking changes in the commit body with:
BREAKING CHANGE: <description> - •Include in breaking changes: Celery paths, database schema, API endpoints, environment variables, or config structure.
- •Examples:
- •
BREAKING CHANGE: Celery tasks moved from services.macro_worker to celery_app. Update docker-compose.yml. - •
BREAKING CHANGE: API endpoint /api/v1/tasks renamed to /api/v2/tasks.
- •
- •For database changes, ensure migrations are included in
scripts/timescale_migrations.sql.
- •Mark breaking changes in the commit body with:
- •
Safety Checks:
- •Never commit
.envfiles or sensitive API keys (FRED_API_KEY, COINGECKO_API_KEY). - •Verify that any new database migrations are included in
scripts/timescale_migrations.sql.
- •Never commit