| # Contributing to FinEE | |
| Thank you for your interest in contributing! Here's how to get started. | |
| ## π¨ Golden Rules | |
| 1. **NEVER push directly to `main`** - All changes go through PRs | |
| 2. **All features branch from `develop`** - Not from main | |
| 3. **Tests MUST pass before merging** - No exceptions | |
| 4. **Update CHANGELOG.md** - Every PR should update it | |
| ## πΏ Branching Strategy (Git Flow) | |
| ``` | |
| main ββββββββββββββββββββββββββββββββββββ (releases only) | |
| β β β | |
| v1.0.3 v1.0.4 v1.1.0 | |
| β β β | |
| develop ββββββββββββββββββββββββββββββββββββ (integration) | |
| β β β β | |
| feature/a βββββββββββββ β β | |
| feature/b βββββββββββββββββββββββββββββ | |
| ``` | |
| ### Branch Types | |
| | Branch | Source | Merges To | Naming | | |
| |--------|--------|-----------|--------| | |
| | `main` | - | - | Protected, releases only | | |
| | `develop` | `main` | `main` | Integration branch | | |
| | `feature/*` | `develop` | `develop` | `feature/add-kotak-support` | | |
| | `fix/*` | `develop` | `develop` | `fix/unicode-amount-parsing` | | |
| | `hotfix/*` | `main` | `main` + `develop` | `hotfix/critical-regex-bug` | | |
| ## π Development Workflow | |
| ### 1. Start a New Feature | |
| ```bash | |
| # Always start from develop | |
| git checkout develop | |
| git pull origin develop | |
| # Create feature branch | |
| git checkout -b feature/my-awesome-feature | |
| # Make changes... | |
| # Write tests... | |
| # Update CHANGELOG.md under [Unreleased] | |
| # Commit with conventional messages | |
| git commit -m "feat: add support for Paytm VPA patterns" | |
| # Push and create PR | |
| git push -u origin feature/my-awesome-feature | |
| # Create PR: feature/my-awesome-feature β develop | |
| ``` | |
| ### 2. Fix a Bug | |
| ```bash | |
| git checkout develop | |
| git pull origin develop | |
| git checkout -b fix/issue-123-unicode-error | |
| # Fix the bug... | |
| # Add test to prevent regression... | |
| git commit -m "fix: handle βΉ symbol in amount parsing" | |
| git push -u origin fix/issue-123-unicode-error | |
| # Create PR: fix/issue-123-unicode-error β develop | |
| ``` | |
| ### 3. Create a Release | |
| **Use the release script:** | |
| ```bash | |
| # Preview what will happen | |
| python scripts/release.py 1.0.4 --dry-run | |
| # Execute release | |
| python scripts/release.py 1.0.4 | |
| ``` | |
| The script will: | |
| 1. β Verify you're on `develop` | |
| 2. β Run all tests | |
| 3. β Run benchmark suite | |
| 4. β Update version in `pyproject.toml` | |
| 5. β Update `CHANGELOG.md` | |
| 6. β Merge to `main` | |
| 7. β Create git tag `v1.0.4` | |
| 8. β Build and upload to PyPI | |
| 9. β Return to `develop` | |
| ## π§ͺ Pre-Merge Checklist | |
| Before your PR can be merged: | |
| - [ ] All tests pass: `pytest tests/ -v` | |
| - [ ] Benchmark runs: `python benchmark.py --all` | |
| - [ ] CHANGELOG.md updated under `[Unreleased]` | |
| - [ ] Code formatted: `black src/ tests/` | |
| - [ ] Linting passes: `ruff check src/ tests/` | |
| - [ ] New features have tests | |
| - [ ] Documentation updated if needed | |
| ## π Commit Message Format | |
| Use [Conventional Commits](https://www.conventionalcommits.org/): | |
| ``` | |
| <type>(<scope>): <description> | |
| [optional body] | |
| [optional footer] | |
| ``` | |
| ### Types | |
| | Type | Description | | |
| |------|-------------| | |
| | `feat` | New feature | | |
| | `fix` | Bug fix | | |
| | `docs` | Documentation only | | |
| | `test` | Adding tests | | |
| | `refactor` | Code refactoring | | |
| | `perf` | Performance improvement | | |
| | `chore` | Maintenance tasks | | |
| ### Examples | |
| ``` | |
| feat(regex): add Lakhs notation support | |
| fix(parser): handle missing spaces in SMS | |
| docs: update README with torture tests | |
| test: add edge cases for Unicode symbols | |
| chore: move notebooks to experiments/ | |
| ``` | |
| ## π Changelog Guidelines | |
| Update `CHANGELOG.md` in every PR under `[Unreleased]`: | |
| ```markdown | |
| ## [Unreleased] | |
| ### Added | |
| - New feature you added | |
| ### Changed | |
| - Behavior you modified | |
| ### Fixed | |
| - Bug you fixed | |
| ``` | |
| **Categories:** | |
| - **Added** - New features | |
| - **Changed** - Changes to existing features | |
| - **Deprecated** - Features to be removed | |
| - **Removed** - Removed features | |
| - **Fixed** - Bug fixes | |
| - **Security** - Security fixes | |
| ## π‘οΈ Protected Branches | |
| | Branch | Direct Push | Force Push | PR Required | | |
| |--------|-------------|------------|-------------| | |
| | `main` | β | β | β (from develop only) | | |
| | `develop` | β | β | β (from feature/fix) | | |
| ## π Thank You! | |
| Every contribution makes FinEE better for the Indian fintech community! | |