Thank you for your interest in contributing to Jeeves!
Every contributor must do the following before getting started:
-
Become a Jeeves Collaborator: Only GitHub Collaborators in the Jeeves repo can submit code, so if you aren't already, reach out to Nathan Weinberg to recieve an invite giving you the appropriate permissions.
-
Fork the Jeeves repo: All work being done must be done within your own fork on a working branch (i.e. not
master
). To submit your work, make a Pull Request from your fork's working branch to themaster
branch of the main repo (more on this below). Do not push branches directly to the main repo for the project; they will be deleted without consultation. -
Clone your fork to your local machine: Navigate to your fork of Jeeves and clone it as follows:
$ git clone git@github.com:<your-github-username>/jeeves.git
- Set your remotes properly: Make sure your remotes are set such that
git remote -v
gives you an output similar to the following:
origin git@github.com:<your-github-username>/jeeves.git (fetch)
origin git@github.com:<your-github-username>/jeeves.git (push)
upstream git@github.com:nathan-weinberg/jeeves.git (fetch)
upstream git@github.com:nathan-weinberg/jeeves.git (push)
To add the upstream
repo, run the following command:
$ git remote add upstream git@github.com:nathan-weinberg/jeeves.git
Now that you've setup your permissions, fork, and remotes properly, it's time to start making your change! Ensure you do the following before you begin to code:
-
Ensure there is an associated GitHub Issue with the work you are going to do: All Pull Requests made must be associated with an issue; if one does not already exist for the change you are making please create one, assign it to yourself, and tag it with the approporate labels.
-
Ensure your working branch is up-to-date: Before creating your working branch, you must ensure it is up-to-date with the latest changes in the main repo's
master
branch. It is recommended you do so in the following way:
[jeeves]$ git checkout master # checkout your master branch
[jeeves]$ git pull upstream master # update your local master branch with latest changes from upstream
[jeeves]$ git push origin master # update your remote master branch with latest changes
[jeeves]$ git checkout -b <working-branch> # create your new working branch containing latest changes
Before you make a Pull Request, make sure you do the following:
-
Test your code: Make sure you test your code thouroughly before submitting; the higher quality a Pull Request is submitted the shorter the review process will be :)
-
Lint your code: Jeeves has its own set of styling guidelines enforced by
flake8
; you can run these locally with the following command:
[jeeves]$ flake8
- Sqaush your commits: In most cases, only one commit per Pull Request will be allowed. Make sure not to submit Pull Requests with multiple commits unless you've consulted with an admin. If you're not sure how to squash commits, there are several guides online with directions on how to do so.
Once you've done all this, make your Pull Request from your fork's working branch to the master
branch of the main repo and make sure to reference the related issue in either the commit message or Pull Request description.
If changes were requested on your Pull Request, update it in the following way to ensure consistency:
- Make the requested changes locally
- Readd the relevant files
- Run
$ git commit --amend
to amend the commit with the requested changes - Run
$ git push -f origin <your-working-branch>
to update the Pull Request
If you want to test a Pull Rquest put up by a Collaborator other than yourself:
- Navigate to your local repo and ensure you've commited or stashed any changes.
- Scroll to the bottom of the Pull Request and click on "command line instructions", right next to the Merge button.
- IMPORTANT: Run the commands under Step 1 only to checkout a new branch on your local repo with the changes present in the Pull Request.
- Test the PR - once you're done simply delete the branch you just created.
Happy contributing!