-
Notifications
You must be signed in to change notification settings - Fork 0
Code contribution guidelines
Before working on a new issue, make sure to pull the latest changes from master using git pull
and create a new branch following the syntax below. Once your pull request is merged, the branch can be deleted.
- Branch names should follow this syntax
<TYPE>/#-<ISSUE TITLE>
: -
<TYPE>
: Type of issue you are working on (usually feature or bugfix) -
#
: The related issue number -
<ISSUE TITLE>
: Meaningful title for the issue, should be insnake_case
If I am assigned to issue #871/Add login form, I would name my branch like so: feature/871-login_form
Try to keep commits at a minimum to not overpopulate the history and also make it easier for reviewers to verify your code. Make sure to include meaningful messages in your commit messages. These practices make it easier for other developers to backtrack in the repository in case a bug infiltrates the master branch.
- Commit messages should follow this syntax
<TYPE>:<MESSAGE>
: -
<TYPE>
: Type of issue you are working on (usually feature or fix) -
MESSAGE
: Meaningful message summarizing the code in the commit
If I fixed a bug involving registration confirmation email not being sent, my commit would be written like so: fix: fix issue preventing registration confirmation email to be sent
Once you've completed an issue on your branch, you should open a new pull request. A PR kind of puts your code into "standby" mode, where other developers can make suggestions on your code or approve it for merging. Here are the steps prior to merging a PR:
- Pull the latest changes from master. If needed, merge master into your branch and fix any conflicts
- Push your code into the GitHub server
- Find your branch in the list of branches of the repo, you should see a button "Compare & pull request"
- At least one person will need to approve your PR before merging it
- Squash and merge your branch, the "squashing" part ensures that the commit history is clean
- Delete your branch
- Close related issues