-
Notifications
You must be signed in to change notification settings - Fork 19
Branching & Commits
To keep our sanity (and our git history) intact, we follow a strict set of rules for how we name branches and write commit messages. It might feel like extra work at first, but it makes tracking down bugs and generating changelogs easier later on.
Direct commits to the develop or master branches are forbidden.
-
develop: This is our main integration branch. It contains the latest features that are ready for the next release. This branch reflects the code currently in beta (app stores) -
master: This reflects the code currently in production (app stores).
All work must be done on a dedicated branch created from develop.
We follow the Conventional Branching strategy. Your branch name should tell us exactly what kind of work is inside it before we even look at the code.
<type>/<short-description>
-
feat: A new feature (e.g., adding a new screen). -
fix: A bug fix (e.g., fixing a crash on login). -
docs: Documentation changes (e.g., updating this wiki). -
style: Formatting, missing semi-colons, etc; no code change. -
refactor: Refactoring production code (e.g., renaming a variable). -
test: Adding missing tests, refactoring tests; no production code change. -
chore: Updating build tasks, package manager configs, etc; no production code change.
- ✅ feat/dark-mode
- ✅ fix/calendar-crash
- ✅ docs/update-readme
- ❌ my-work (Too vague)
- ❌ fix_login (Wrong separator, use /)
We use Conventional Commits. This allows us to automatically generate changelogs and version numbers based on the commit history.
<type>(<optional scope>): <description>
[optional body]
[optional footer(s)]
-
Type: Must be one of the types listed above (feat, fix, chore, etc.).
-
Scope (Optional): The specific part of the codebase you touched (e.g., login, map, ui).
-
Description: A short summary of the change. Use the imperative mood ("add" not "added", "fix" not "fixed").
-
Body (Optional): A longer description of why you made the change.
-
Footer (Optional): References to issues (e.g., Closes #123) or breaking changes.
- A simple feature:
feat(calendar): add support for weekly view
- A bug fix with a reference:
fix(auth): handle timeout error on slow networks
The app was crashing when the API took longer than 5s to respond.
Added a try-catch block to handle the TimeoutException.
Closes #42
- A breaking change (Scary!):
feat(api): update to v2 endpoints
BREAKING CHANGE: The fetchSchedule function now requires a specialized token.
We have a script that automatically formats your code whenever you try to commit. If you don't use this, the CI pipeline will likely fail because of formatting issues.
How to install it: Run this once from the root of the repository:
chmod +x pre-commit-hook.sh
./pre-commit-hook.sh
What it does:
-
When you run
git commit, the hook triggers. -
It runs
dart formaton your staged files. -
If it changes anything, it effectively "cleans up" your mess before saving the commit.
Here is how a typical contribution cycle looks:
git checkout develop
git pull origin developgit checkout -b feat/new-login-screenWrite code, save files.
git add .
git commit -m "feat(login): implement new UI design"(The pre-commit hook runs here. If it modifies files, you might need to add them and commit again).
5. Push:
git push -u origin feat/new-login-screenGo to GitHub and open a PR targeting develop.