Instructions for Developers
We would love for you to contribute new code, bugfixes, or documentation!
Development Workflow
We use a git-based feature branch workflow. This means that new development should happen on a feature-specific branch, which will then be merged in to the main
branch via a pull request that includes a peer-review of the feature code.
Here is an outline of the workflow:
-
Check out the
main
branch and ensure it is up-to-date with the remote repository -
Create a new branch for your feature:
-
Develop your feature on the feature branch, using some combination of commands like
at this stage you can alsogit push
your branch to the remote repository if you want others to see and/or collaborate on your branch, or you can keep it local. -
Once you have finished developing your feature, you should perform some housekeeping to ensure your code conforms to standards:
Note: if you have access to
make
on your system, you can run the following commands via the shortcutsmake format
,make lint
, andmake test
(seeMakefile
)
-
Ensure that your branch is up-to-date with main:
Other developers may have committed changes to
main
since you started your branch. You should make sure you pull in those changes to avoid merge conflicts. To do this, from your feature branch run: -
Format your code:
These tools will automatically format your code files to match our chosen formatting standard.
-
Lint your code:
These tools will run some static code analysis tools to point out possible issues or improvements. You should try to fix as many of the issues flagged as possible. If there is something that you aren't sure about, feel free to note it in a comment in your pull request (next step)
-
Run automated tests
This will run automated tests that we have written, to ensure that your feature hasn't broken some functionality elsewhere. You should also add tests for your new feature!
5. Request that your feature branch be merged in to the main
branch by opening a pull-request.
Navigate to the Pull Requests tab on github. Click New pull request
and follow the instructions. You should assign yourself to the pull request, and you can request a code review by assigning a reviewer (Alternatively, post on the group slack to say that a feature is ready for review!)
6. Address Code Review comments
The code reviewer may make ask questions or suggest improvements via comments on the pull request. Simply address the comments via new commits to your feature branch
7. Merge your feature!
Hit merge in the pull request on github. Merge and Squash
is the prefered method, as this will squash all of your feature commits into a single commit, keeping the main
branch history clean.