We welcome PRs. Keep main clean, iterate fast on develop.
Branch roles
- main: stable, tagged releases only (comes from develop).
- develop: integration branch (target of normal PRs).
- feature_ or feature_-: new code (from develop).
- bugfix_-: fix for something already in develop.
- hotfix_-: urgent production fix (from main → PR to main → merge back into develop).
- issue--: automatically created from a GitHub issue (allowed and recommended).
You can create a branch manually or use GitHub’s "Create branch" button on an issue, which will name it like issue-123-description. This is fully supported and recommended for traceability.
Flow
- Update local: git fetch origin && git switch develop && git pull --ff-only
- Create branch: git switch -c feature/better-forecast
- Code + tests + docs (README / CONFIG_README / MQTT if behavior changes)
- Run formatting, lint, tests
- Ensure all Python files are formatted with Black (
black .)- Tip for VS Code users: Install the Black Formatter extension for automatic formatting on save. (// VS Code settings.json "[python]": { "editor.formatOnSave": true })
- Run pylint and ensure a score of 9.0 or higher for all files (
pylint src/) - tests - see info at guidelines below
- Ensure all Python files are formatted with Black (
- Rebase before PR: git fetch origin && git rebase origin/develop
- Push: git push -u origin feature/better-forecast
- Open PR → base: develop (link issues: Closes #123)
- Keep PR focused; squash or rebase merge (no merge commits)
Commits (Conventional) feat: add battery forecast smoothing fix: correct negative PV handling docs: update MQTT topic table
Hotfix git switch main git pull --ff-only git switch -c hotfix/overrun-calc ...fix... PR → main, tag release, then: git switch develop && git merge --ff-only main
Guidelines
- One logical change per PR
- Add/adjust tests for logic changes
- Use pytest for all unit and integration tests.
- Place tests in the
tests/directory, organized to mirror the structure of thesrc/directory:- Create a subfolder for each source module or feature (e.g., if your code is in
src/interfaces/mqtt_interface.py, place tests intests/interfaces/test_mqtt_interface.py). - Name test files as
test_<uut-filename>.py(e.g.,test_mqtt_interface.pyformqtt_interface.py).
- Create a subfolder for each source module or feature (e.g., if your code is in
- Document new config keys / API / MQTT topics
- Prefer clarity over cleverness
Thanks for contributing!