Welcome to matcha
🍵! We're excited that you're thinking about contributing to our project.
Contributions are made to this project using Issues and Pull Request (PRs). Before creating your own, search for existing Issues and PRs - as I'm sure you're aware, this removes duplication and makes everyone's life easier!
Issues should be used to report bugs with matcha
, proposing new features before a PR is raised, and to request new features. We're making use of templates to make this process easier for you and consistent for everyone - this will appear when you create an issue.
If you find an issue that has already been reported by another good samaritan, then please add your own reproduction information to the existing issue rather than creating a new one. Reacting to issues can also help our maintainers understand that the issue is affecting more than one reporter.
Pull Requests (PRs) are how contributions are made to matcha
and are always welcome.
The preferred way to contribute to matcha
is to fork the main repository on Github and then submit a pull request.
Here, we'll explain to get setup locally with matcha
and how to set up your git repository:
-
If you don't already have one, create an account on Github.
-
Fork the repository by clicking on the 'fork' button near the top of the page. What this will do is create a copy of the
matcha
repository under your Github account. See here for a guide on how to fork a repository. -
Clone this forked version of
matcha
to your local disk:
git clone [email protected]:<your_username>/matcha.git
cd matcha
- Add the
upstream
remote. Adding this means you can keep your repository sync'd with the latest changes to the main repository:
git remote add upstream [email protected]:fuzzylabs/matcha.git
- Check that these remote aliases are correctly configured by running:
git remote -v
, this should show the following:
origin [email protected]:<your_username>/matcha.git (fetch)
origin [email protected]:<your_username>/matcha.git (push)
upstream [email protected]:fuzzylabs/matcha.git (fetch)
upstream [email protected]:fuzzylabs/matcha.git (push)
Now you have git properly configured, you can install the development dependencies which are described in DEVELOPMENT. Once the development environment is setup, you can start making changes by following these steps:
- Sync your
main
branch with theupstream/main
branch:
git checkout main
git fetch upstream
git merge upstream/main
- Create your feature branch which will contain your development changes:
git checkout -b <your_feature>
and you can now start making changes! We're sure that you don't need reminding but it's good practise to never work on the main
branch and to always use a feature branch. The DEVELOPMENT guide tells you how to run tests.
- Develop your feature on your computer and when you're done editing, add the changed files to git and then commit:
git add <modified_files>
git commit -m '<a meaningful commit message>'
Once committed, push your changes to your Github account:
git push -u origin <your_feature>
- Once you're finished and ready to make a pull request to the main repository, then follow the steps below
Before a PR can be merged, two core developers need to approve it. It may be the case that you have an incomplete contribution, where you're expecting to do more work before receiving a full review, and these should have the prefix [WIP]
- this will indicate to everyone that it is a work in progress ticket and will avoid duplicated work. These types of PRs often benefit from including a task list in the PR description.
It's important to do the following, and the PR template that you'll see will ask you explicitly:
-
Give your pull request a helpful title which summarizes what your contribution does.
-
Make sure your code passes the tests. At the moment, running the whole test suite doesn't take a long time so we advice doing that with
pytest
(see the DEVELOPMENT guide). -
Your PR will also be checked for spelling errors in the CI by the
typos
crate. If a false positive is raised by the checker, consider adding it to the.typos.toml
file in the root of the project. -
Ensure that your code is documented and commented, and that the documentation renders properly.