Ranjit Behera
commited on
Commit
Β·
7b52500
1
Parent(s):
1eeb36e
docs: add CONTRIBUTING.md with branching strategy
Browse files- CONTRIBUTING.md +118 -0
CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributing to FinEE
|
| 2 |
+
|
| 3 |
+
Thank you for your interest in contributing! Here's how to get started.
|
| 4 |
+
|
| 5 |
+
## πΏ Branching Strategy
|
| 6 |
+
|
| 7 |
+
We use **Git Flow** for professional development:
|
| 8 |
+
|
| 9 |
+
```
|
| 10 |
+
main ββββββββββββββββββββββββββββββββββ (stable releases only)
|
| 11 |
+
β β β β
|
| 12 |
+
β β βββtag:v1.0.3β
|
| 13 |
+
β β β
|
| 14 |
+
develop ββββββββββββββββββββββββββββββββββ (integration branch)
|
| 15 |
+
β β β
|
| 16 |
+
feature/xyz ββββββββββββββββββββ (feature branches)
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
### Branches
|
| 20 |
+
|
| 21 |
+
| Branch | Purpose | Merge To |
|
| 22 |
+
|--------|---------|----------|
|
| 23 |
+
| `main` | Stable releases only | - |
|
| 24 |
+
| `develop` | Integration & testing | `main` (via PR) |
|
| 25 |
+
| `feature/*` | New features | `develop` (via PR) |
|
| 26 |
+
| `fix/*` | Bug fixes | `develop` (via PR) |
|
| 27 |
+
| `hotfix/*` | Urgent production fixes | `main` + `develop` |
|
| 28 |
+
|
| 29 |
+
### Workflow
|
| 30 |
+
|
| 31 |
+
1. **New Feature**:
|
| 32 |
+
```bash
|
| 33 |
+
git checkout develop
|
| 34 |
+
git pull origin develop
|
| 35 |
+
git checkout -b feature/my-feature
|
| 36 |
+
# ... make changes ...
|
| 37 |
+
git push -u origin feature/my-feature
|
| 38 |
+
# Create PR to develop
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
2. **Bug Fix**:
|
| 42 |
+
```bash
|
| 43 |
+
git checkout develop
|
| 44 |
+
git checkout -b fix/issue-123
|
| 45 |
+
# ... fix bug ...
|
| 46 |
+
git push -u origin fix/issue-123
|
| 47 |
+
# Create PR to develop
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
3. **Release**:
|
| 51 |
+
```bash
|
| 52 |
+
git checkout main
|
| 53 |
+
git merge develop
|
| 54 |
+
git tag -a v1.x.x -m "Release v1.x.x"
|
| 55 |
+
git push origin main --tags
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## π§ͺ Running Tests
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
# Install dev dependencies
|
| 62 |
+
pip install -e ".[dev]"
|
| 63 |
+
|
| 64 |
+
# Run all tests
|
| 65 |
+
pytest tests/ -v
|
| 66 |
+
|
| 67 |
+
# Run specific test
|
| 68 |
+
pytest tests/test_regex_engine.py -v
|
| 69 |
+
|
| 70 |
+
# Run with coverage
|
| 71 |
+
pytest tests/ --cov=finee --cov-report=html
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## π Code Style
|
| 75 |
+
|
| 76 |
+
- **Black** for formatting (line length: 100)
|
| 77 |
+
- **Ruff** for linting
|
| 78 |
+
- **Type hints** for all public functions
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
# Format code
|
| 82 |
+
black src/ tests/
|
| 83 |
+
|
| 84 |
+
# Lint
|
| 85 |
+
ruff check src/ tests/
|
| 86 |
+
|
| 87 |
+
# Type check
|
| 88 |
+
mypy src/finee/
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## π Publishing
|
| 92 |
+
|
| 93 |
+
Only maintainers can publish to PyPI:
|
| 94 |
+
|
| 95 |
+
```bash
|
| 96 |
+
# Bump version in pyproject.toml
|
| 97 |
+
# Build
|
| 98 |
+
python -m build
|
| 99 |
+
|
| 100 |
+
# Upload
|
| 101 |
+
twine upload dist/*
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
## π Commit Messages
|
| 105 |
+
|
| 106 |
+
Use conventional commits:
|
| 107 |
+
|
| 108 |
+
```
|
| 109 |
+
feat: add support for Lakhs notation
|
| 110 |
+
fix: handle Unicode βΉ symbol in regex
|
| 111 |
+
docs: update README with torture tests
|
| 112 |
+
test: add edge case tests for truncated SMS
|
| 113 |
+
chore: move notebooks to experiments/
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
## π Thank You!
|
| 117 |
+
|
| 118 |
+
Every contribution helps make FinEE better for the Indian fintech community.
|