|
| 1 | +============ |
| 2 | +Contributing |
| 3 | +============ |
| 4 | + |
| 5 | +Contributions are welcome and appreciated! |
| 6 | +Every little bit helps, and credit will always be given. |
| 7 | + |
| 8 | +.. _issue : https://github.com/nexB/deltacode/issue |
| 9 | +__ issue_ |
| 10 | + |
| 11 | +If you are new to DeltaCode and want to find easy tickets to work on, |
| 12 | +check `easy issues <https://github.com/nexB/deltacode/labels/easy>`_ |
| 13 | + |
| 14 | +When contributing to DeltaCode (such as code, bugs, documentation, etc.) you |
| 15 | +agree to the Developer `Certificate of Origin <http://developercertificate.org/>`_ |
| 16 | +and the DeltaCode license (see the `NOTICE <https://github.com/nexB/deltacode/blob/develop/NOTICE>`_ file). |
| 17 | +The same approach is used by the Linux Kernel developers and several other projects. |
| 18 | + |
| 19 | +For commits, it is best to simply add a line like this to your commit message, |
| 20 | +with your name and email:: |
| 21 | + |
| 22 | + Signed-off-by: Jane Doe <developer@example.com> |
| 23 | + |
| 24 | +Please try to write a good commit message, see `good commit message wiki |
| 25 | +<https://github.com/nexB/aboutcode/wiki/Writing-good-commit-messages>`_ for |
| 26 | +details. In particular use the imperative for your commit subject: think that |
| 27 | +you are giving an order to the codebase to update itself. |
| 28 | + |
| 29 | + |
| 30 | +Feature requests and feedback |
| 31 | +============================= |
| 32 | + |
| 33 | +To send feedback or ask a question, `file an issue <issues_>`_ |
| 34 | + |
| 35 | +If you are proposing a feature: |
| 36 | + |
| 37 | +* Explain how it would work. |
| 38 | +* Keep the scope simple possible to make it easier to implement. |
| 39 | +* Remember that your contributions are welcomed to implement this feature! |
| 40 | + |
| 41 | + |
| 42 | +Chat with other developers |
| 43 | +========================== |
| 44 | + |
| 45 | +For other questions, discussions, and chats, we have: |
| 46 | + |
| 47 | +- an official Gitter channel at https://gitter.im/aboutcode-org/discuss |
| 48 | + Gitter also has an IRC bridge at https://irc.gitter.im/ |
| 49 | + This is the main place where we chat and meet. |
| 50 | + |
| 51 | +- an official #aboutcode IRC channel on freenode (server chat.freenode.net) |
| 52 | + for DeltaCode and other related tools. You can use your |
| 53 | + favorite IRC client or use the web chat at https://webchat.freenode.net/ . |
| 54 | + This is a busy place with a lot of CI and commit notifications that makes |
| 55 | + actual chat sometimes difficult! |
| 56 | + |
| 57 | +- a mailing list at `sourceforge <https://lists.sourceforge.net/lists/listinfo/aboutcode-discuss>`_ |
| 58 | + |
| 59 | + |
| 60 | +Bug reports |
| 61 | +=========== |
| 62 | + |
| 63 | +When `reporting a bug`__ please include: |
| 64 | + |
| 65 | +* Your operating system name, version and architecture (32 or 64 bits). |
| 66 | +* Your Python version. |
| 67 | +* Your DeltaCode version. |
| 68 | +* Any additional details about your local setup that might be helpful to |
| 69 | + diagnose this bug. |
| 70 | +* Detailed steps to reproduce the bug, such as the commands you ran and a link |
| 71 | + to the code you are scanning. |
| 72 | +* The errors messages or failure trace if any. |
| 73 | +* If helpful, you can add a screenshot as an issue attachment when relevant or |
| 74 | + some extra file as a link to a `Gist <https://gist.github.com>`_. |
| 75 | + |
| 76 | + |
| 77 | +Documentation improvements |
| 78 | +========================== |
| 79 | + |
| 80 | +Documentation can come in the form of wiki pages, docstrings, blog posts, |
| 81 | +articles, etc. Even a minor typo fix is welcomed. |
| 82 | +See also extra documentation on the `Wiki <https://github.com/nexB/deltacode/wiki>`_. |
| 83 | + |
| 84 | + |
| 85 | +Development |
| 86 | +=========== |
| 87 | + |
| 88 | +To set up DeltaCode for local development: |
| 89 | + |
| 90 | +1. Fork the deltacode on GitHub, click `fork <https://github.com/nexb/deltacode/fork>`_ button |
| 91 | + |
| 92 | +2. Clone your fork locally: |
| 93 | + |
| 94 | + Use SSH:: |
| 95 | + |
| 96 | + git clone git@github.com:your_name_here/deltacode.git |
| 97 | + |
| 98 | + Or use HTTPS:: |
| 99 | + |
| 100 | + git clone https://github.com/your_name_here/deltacode.git |
| 101 | + |
| 102 | + See also GitHub docs dor `SSH <https://help.github.com/articles/connecting-to-github-with-ssh/>`_ |
| 103 | + or `HTTPS <https://help.github.com/articles/which-remote-url-should-i-use/#cloning-with-https-urls-recommended>`_ |
| 104 | + |
| 105 | + If you want to change the connection type, do following |
| 106 | + |
| 107 | + SSH to HTTPS :: |
| 108 | + |
| 109 | + git remote set-url <repository-alias-name> https://github.com/your_name_here/deltacode.git |
| 110 | + |
| 111 | + HTTPS to SSH :: |
| 112 | + |
| 113 | + git remote set-url <repository-alias-name> git@github.com:your_name_here/deltacode.git |
| 114 | + |
| 115 | + Generally <repository-alias-name> is named origin, but in the case of multiple fetch/pull source of repository you can choose whatever name you want |
| 116 | + |
| 117 | +3. Create a branch for local development:: |
| 118 | + |
| 119 | + git checkout -b name-of-your-bugfix-or-feature |
| 120 | + |
| 121 | +4. To configure your local environment for development, locate to the main |
| 122 | + directory of the local repository, run the configure script. |
| 123 | + The configure script creates an isolated Python `virtual environment` in |
| 124 | + your checkout directory, the Python `pip` tool, and installs the thirdparty |
| 125 | + libraries (from the `thirdparty/ directory`), setup the paths, etc. |
| 126 | + See https://virtualenv.pypa.io/en/latest/ for more details. |
| 127 | + |
| 128 | + Run this command to configure DeltaCode:: |
| 129 | + |
| 130 | + ./configure |
| 131 | + |
| 132 | + On Windows use instead:: |
| 133 | + |
| 134 | + configure |
| 135 | + |
| 136 | + Then run this: `source bin/activate` or `. bin/activate` |
| 137 | + (or run `bin\\activate` on Windows) |
| 138 | + |
| 139 | + When you create a new terminal/shell to work on DeltaCode rerun the activate step. |
| 140 | + |
| 141 | + When you pull new code from git, rerun ./configure |
| 142 | + |
| 143 | + |
| 144 | +5. Now you can make your code changes in your local clone. |
| 145 | + Please create new unit tests for your code. We love tests! |
| 146 | + |
| 147 | +6. When you are done with your changes, run all the tests. |
| 148 | + Use this command:: |
| 149 | + |
| 150 | + py.test |
| 151 | + |
| 152 | + Or use the -n6 option to run on 6 threads in parallel and run tests faster:: |
| 153 | + |
| 154 | + py.test -n6 |
| 155 | + |
| 156 | +7. Check the status of your local repository before commit, regarding files changed:: |
| 157 | + |
| 158 | + git status |
| 159 | + |
| 160 | + |
| 161 | +8. Commit your changes and push your branch to your GitHub fork:: |
| 162 | + |
| 163 | + git add <file-changed-1> <file-changed-2> <file-changed-3> |
| 164 | + git commit -m "Your detailed description of your changes." --signoff |
| 165 | + git push <repository-alias-name> name-of-your-bugfix-or-feature |
| 166 | + |
| 167 | +9. Submit a pull request through the GitHub website for this branch. |
| 168 | + |
| 169 | + |
| 170 | +Pull Request Guidelines |
| 171 | +----------------------- |
| 172 | + |
| 173 | +If you need a code review or feedback while you are developing the code just |
| 174 | +create a pull request. You can add new commits to your branch as needed. |
| 175 | + |
| 176 | +For merging, your request would need to: |
| 177 | + |
| 178 | +1. Include unit tests that are passing (run ``py.test``). |
| 179 | +2. Update documentation as needed for new API, functionality etc. |
| 180 | +3. Add a note to ``CHANGELOG.rst`` about the changes. |
| 181 | +4. Add your name to ``AUTHORS.rst``. |
| 182 | + |
| 183 | + |
| 184 | +Test tips |
| 185 | +--------- |
| 186 | + |
| 187 | +To run a subset of test functions containing test_myfeature in their name use:: |
| 188 | + |
| 189 | + py.test -k test_myfeature |
| 190 | + |
| 191 | +To run the tests from a single test file:: |
| 192 | + |
| 193 | + py.test tests/commoncode/test_fileutils.py |
| 194 | + |
| 195 | +To run tests in parallel on eight processors:: |
| 196 | + |
| 197 | + py.test -n 8 |
| 198 | + |
| 199 | +To run tests verbosely, displaying all print statements to terminal:: |
| 200 | + |
| 201 | + py.test -vvs |
0 commit comments