|
| 1 | +============ |
| 2 | +Contributing |
| 3 | +============ |
| 4 | + |
| 5 | +Contributions are welcome and appreciated! |
| 6 | +Every little bit helps, and credit will always be given. |
| 7 | + |
| 8 | +When contributing to ScanCode (such as code, bugs, documentation, etc.) you agree to the |
| 9 | +Developer Certificate of Origin http://developercertificate.org/ and the ScanCode license (see the NOTICE file) |
| 10 | + |
| 11 | +Feature requests and feedback |
| 12 | +============================= |
| 13 | + |
| 14 | +To send feedback file an issue at https://github.com/scancode/scancode-toolkit/issues |
| 15 | + |
| 16 | +If you are proposing a feature: |
| 17 | + |
| 18 | +* Explain how it would work. |
| 19 | +* Keep the scope simple possible to make it easier to implement. |
| 20 | +* Remember that your contributions are welcomed to implement this feature! |
| 21 | + |
| 22 | + |
| 23 | +Bug reports |
| 24 | +=========== |
| 25 | + |
| 26 | +When reporting a bug at https://github.com/nexb/scancode-toolkit/issues please include: |
| 27 | + |
| 28 | +* Your operating system name, version and architecture (32 or 64 bits). |
| 29 | +* Your Python version. |
| 30 | +* Your ScanCode version. |
| 31 | +* Any additional details about your local setup that might be helpful to diagnose this bug. |
| 32 | +* Detailed steps to reproduce the bug, such as the commands you ran and a link to the code you are scanning. |
| 33 | +* The errors messages or failure trace if any. |
| 34 | +* If helpful, you can add a screenshot as an issue attachment when relevant or some extra file as a link to a Gist https://gist.github.com |
| 35 | + |
| 36 | + |
| 37 | +Documentation improvements |
| 38 | +========================== |
| 39 | + |
| 40 | +Documentation can come in the form of wiki pages, docstrings, blog posts, articles, etc. |
| 41 | +Even a minor typo fix is welcomed. |
| 42 | + |
| 43 | + |
| 44 | +Development |
| 45 | +=========== |
| 46 | + |
| 47 | +To set up ScanCode for local development: |
| 48 | + |
| 49 | +1. Fork the scancode-toolkit on GitHub https://github.com/nexb/scancode-toolkit/fork |
| 50 | + |
| 51 | +2. Clone your fork locally:: |
| 52 | + |
| 53 | + git clone [email protected]:your_name_here/scancode-toolkit.git |
| 54 | + |
| 55 | +3. Create a branch for local development:: |
| 56 | + |
| 57 | + git checkout -b name-of-your-bugfix-or-feature |
| 58 | + |
| 59 | +4. Configure your local environment for development, run the configure script. |
| 60 | + |
| 61 | + The configure script creates an isolated Python `virtual environment` in your checkout directory, the Python `pip` |
| 62 | + tool, and installs the thirdparty libraries (from the `thirdparty/ directory`), setup the paths, etc. |
| 63 | + See https://virtualenv.pypa.io/en/latest/ for more. Run this command :: |
| 64 | + |
| 65 | + source configure |
| 66 | + |
| 67 | + On Windows use instead:: |
| 68 | + |
| 69 | + configure |
| 70 | + |
| 71 | + When you create a new terminal/shell to work on ScanCode, either rerun the configure script or |
| 72 | + `source bin/activate` (or just run bin\actiavte on Windows) |
| 73 | + |
| 74 | + |
| 75 | +5. Now you can make your code changes in your local clone. |
| 76 | + Please create new unit tests for your code. |
| 77 | + |
| 78 | +6. When you are done with your changes, run all the tests. |
| 79 | + Use this command:: |
| 80 | + |
| 81 | + py.test |
| 82 | + |
| 83 | + Or use the -n6 option to run on 6 threads in parallel and run tests faster:: |
| 84 | + |
| 85 | + py.test -n6 |
| 86 | + |
| 87 | +7. Commit your changes and push your branch to your GitHub fork:: |
| 88 | + |
| 89 | + git add . |
| 90 | + git commit -m "Your detailed description of your changes." |
| 91 | + git push origin name-of-your-bugfix-or-feature |
| 92 | + |
| 93 | +8. Submit a pull request through the GitHub website for this branch. |
| 94 | + |
| 95 | + |
| 96 | +Pull Request Guidelines |
| 97 | +----------------------- |
| 98 | + |
| 99 | +If you need a code review or feedback while you are developing the code just |
| 100 | +create a pull request. You can add new commits to your branch as needed. |
| 101 | + |
| 102 | +For merging, your request would need to: |
| 103 | + |
| 104 | +1. Include unit tests that are passing (run ``py.test``). |
| 105 | +2. Update documentation as needed for new API, functionality etc. |
| 106 | +3. Add a note to ``CHANGELOG.rst`` about the changes. |
| 107 | +4. Add your name to ``AUTHORS.rst``. |
| 108 | + |
| 109 | + |
| 110 | +Test tips |
| 111 | +--------- |
| 112 | + |
| 113 | +To run a subset of test functions containing test_myfeature in their name use:: |
| 114 | + |
| 115 | + py.test -k test_myfeature |
| 116 | + |
| 117 | +To run the tests from a single test file:: |
| 118 | + |
| 119 | + py.test tests/commoncode/test_fileutils.py |
| 120 | + |
| 121 | +To run tests in parallel on 8 processes:: |
| 122 | + |
| 123 | + py.test -n 8 |
| 124 | + |
0 commit comments