|
| 1 | +# How to contribute to U.S. Digital Response projects |
| 2 | + |
| 3 | +Everyone is welcome to contribute, and we value everybody's contribution. Code |
| 4 | +is not the only way to help the community. Answering questions, helping |
| 5 | +others, reaching out, and improving the documentation are all immensely valuable |
| 6 | +to the community. |
| 7 | + |
| 8 | + |
| 9 | +## You can contribute in so many ways! |
| 10 | + |
| 11 | +There are 3 ways you can contribute to this project: |
| 12 | + |
| 13 | +- Fixing outstanding issues with the existing code; |
| 14 | +- Contributing to the examples or to the documentation; |
| 15 | +- Submitting issues related to bugs or desired new features. |
| 16 | + |
| 17 | +_All are equally valuable to the community._ |
| 18 | + |
| 19 | +We also onboard new volunteers to USDR projects in general at [https://www.usdigitalresponse.org/raisingyourhand](https://www.usdigitalresponse.org/raisingyourhand). Please sign up if you’d like to help on other projects. |
| 20 | + |
| 21 | + |
| 22 | +## Submitting a new issue or feature request |
| 23 | + |
| 24 | +Do your best to follow these guidelines when submitting an issue or a feature |
| 25 | +request. It will make it easier for us to come back to you quickly and with good |
| 26 | +feedback. |
| 27 | + |
| 28 | + |
| 29 | +### Did you find a bug? |
| 30 | + |
| 31 | +Open source code is robust and reliable thanks to the users who notify us of |
| 32 | +the problems they encounter, so thank you for reporting an issue. |
| 33 | + |
| 34 | +First, we would really appreciate it if you could **make sure the bug was not |
| 35 | +already reported** (use the search bar on GitHub under the “Issues” tab). |
| 36 | + |
| 37 | +Did not find it? :( So we can act quickly on it, please include the following: |
| 38 | + |
| 39 | +- Your **operating system**. |
| 40 | +- If the problem is with the API, your **client (e.g. cURL, Python Requests)**. |
| 41 | +- If the problem was with the demo UI or docs pages, your **browser (e.g. Firefox, Chrome, Edge, Internet Explorer)**. |
| 42 | +- Any code errors that you have access to. |
| 43 | + |
| 44 | + |
| 45 | +### Do you want a new feature? |
| 46 | + |
| 47 | +A world-class feature request addresses the following points: |
| 48 | + |
| 49 | +1. Motivation first: |
| 50 | + |
| 51 | +- Is it related to a problem/frustration with the current system? If so, please explain why. |
| 52 | +- Is it related to something you would need for a project? We'd love to hear about it! |
| 53 | +- Is it something you worked on and think could benefit the community? Awesome! Tell us what problem it solved for you. |
| 54 | + |
| 55 | +2. Write a _full paragraph_ describing the feature; |
| 56 | +3. Provide a **code snippet** or **design mockup or sketch** if possible, to demonstrate its future use. |
| 57 | + |
| 58 | +If your issue is well written, we’re already 80% of the way there by the time you |
| 59 | +post it. |
| 60 | + |
| 61 | + |
| 62 | +## Start contributing! (Pull Requests) |
| 63 | + |
| 64 | +Before writing code, we strongly advise you to search through the exising PRs or |
| 65 | +issues to make sure that nobody is already working on the same thing. If you are |
| 66 | +unsure, it is always a good idea to open an issue to get some feedback. |
| 67 | + |
| 68 | +You will need basic `git` proficiency to be able to contribute to |
| 69 | +this project. `git` is not the easiest tool to use but it has the greatest |
| 70 | +manual. Type `git --help` in a shell and enjoy. |
| 71 | + |
| 72 | +Follow these steps to start contributing: |
| 73 | + |
| 74 | +1. Fork the repository by |
| 75 | + clicking on the 'Fork' button on the repository's page. This creates a copy of the code |
| 76 | + under your GitHub user account. |
| 77 | + |
| 78 | +2. Clone your fork to your local disk |
| 79 | + |
| 80 | +3. Create a new branch to hold your development changes: |
| 81 | + |
| 82 | + ```bash |
| 83 | + $ git checkout -b a-descriptive-name-for-my-changes |
| 84 | + ``` |
| 85 | + |
| 86 | + please avoid working on the `main` or `gh-pages` branch directly. |
| 87 | + |
| 88 | +4. Develop the features on your branch. |
| 89 | + |
| 90 | + Once you're happy with your changes, add changed files using `git add` and |
| 91 | + make a commit with `git commit` to record your changes locally: |
| 92 | + |
| 93 | + ```bash |
| 94 | + $ git add modified_file.py |
| 95 | + $ git commit |
| 96 | + ``` |
| 97 | + |
| 98 | + Please write [good commit messages](https://chris.beams.io/posts/git-commit/). |
| 99 | + |
| 100 | + It is a good idea to sync your copy of the code with the original |
| 101 | + repository regularly. This way you can quickly account for changes: |
| 102 | + |
| 103 | + ```bash |
| 104 | + $ git fetch origin |
| 105 | + $ git rebase origin/master |
| 106 | + ``` |
| 107 | + |
| 108 | + Push the changes to your account using: |
| 109 | + |
| 110 | + ```bash |
| 111 | + $ git push -u origin a-descriptive-name-for-my-changes |
| 112 | + ``` |
| 113 | + |
| 114 | +5. Once you are satisfied (**and the checklist below is happy, too**), go to the |
| 115 | + webpage of your fork on GitHub. Click on 'Pull request' to send your changes |
| 116 | + to the project maintainers for review. |
| 117 | + |
| 118 | +6. It's ok if maintainers ask you for changes. It happens to core contributors |
| 119 | + too! So everyone can see the changes in the Pull request, work in your local |
| 120 | + branch and push the changes to your fork. They will automatically appear in |
| 121 | + the pull request. |
| 122 | + |
| 123 | + |
| 124 | +### Checklist |
| 125 | + |
| 126 | +1. The title of your pull request should be a summary of its contribution; |
| 127 | + |
| 128 | +2. If your pull request adresses an issue, please [mention the issue number in |
| 129 | + the pull request description to make sure they are linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) (and so people consulting the issue know you are working on it); |
| 130 | + |
| 131 | +3. To indicate a work in progress, please submit your pull request as a draft. |
| 132 | + This is useful to avoid duplicated work, and to differentiate it from PRs |
| 133 | + ready to be merged. |
| 134 | + |
| 135 | +  |
| 136 | + |
| 137 | +4. If there are any tests, make sure that they pass and cover your new features and bugfixes. |
| 138 | + |
| 139 | + |
| 140 | +#### This guide was based on [HuggingFace/transformers](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) which was itself based on [SciKit-Learn](https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md) |
0 commit comments