-
Notifications
You must be signed in to change notification settings - Fork 26
How to Contribute
Before implementing any changes, you need to add pre-commit hooks we provide to check code styles. Under the git root directory, run ln -s -f $PATH_TO_KYRIX/docker-scripts/pre-commit $PATH_TO_KYRIX/.git/hooks/pre-commit
. PATH_TO_KYRIX
is the absolute path to your Kyrix root directory. Note that you need to have npm
and java
installed.
After this, an automated script will check the code styles of your changes every time you make a commit.
- Make sure you're on the master branch.
git branch -l
If not, switch to the master branch.git checkout master
- Pull the latest updates from master
git pull origin master
- Create a new branch named after the feature that you're implementing
git checkout -b "my_new_feature"
- Push the branch to origin, setting up tracking
git push -u origin my_new_feature
- Implement your changes, making sure to regularly commit with good commit messages and push your changes with
git push origin my_new_feature
-
After pushing, check the main github page of the project and there should be an option to create a pull request from your recently pushed branch.
-
Make the pull request and give a brief description. If the pull request addresses an open issue (say, issue 4), add the text
closes #4
to the body of the request, so that merging the pull request will also close the issue. -
Let others review and approve the pull request. This may require you to make new commits to the branch, which can be added to the pull request with
git push origin my_new_feature
. Eventually, the reviewer approves the changes (commenting on the pull request). -
If your branch is clear to merge, there should be a big green button on the bottom of the page that lets you merge. You might have some merge conflicts, however, in which case the merge button will be red. To resolve this, get the latest changes on master (
git merge master
), then rungit status
to see which files have conflicts. -
Now, squash your changes into a single commit to keep the log clean. To do this, go to your PR page, push the big green button saying "Squash and merge". We do not allow other types of merge.
-
Push the "delete this branch" button to remove your remote feature branch. Your local repo doesn't know that the remote branch has been deleted, so clean up state with:
git checkout master git branch -D my_new_feature
-
All done!
We recommend using docker for consistent dev environments. Every time you make a change (to compiler
, back-end
or front-end
), you can run docker-compose build
to send your changes into the containers.