Contributions are welcome and appreciated! Every little bit helps, and credit will always be given.
When contributing to ScanCode (such as code, bugs, documentation, etc.) you agree to the Developer Certificate of Origin http://developercertificate.org/ and the ScanCode license (see the NOTICE file). The same approach is used by the Linux Kernel developers.
For commits, simply add a line like this to your commit message, with your name and email:
Signed-off-by: Jane Doe <[email protected]>
To send feedback, file an issue at https://github.com/scancode/scancode-toolkit/issues
If you are proposing a feature:
- Explain how it would work.
- Keep the scope simple possible to make it easier to implement.
- Remember that your contributions are welcomed to implement this feature!
When reporting a bug at https://github.com/nexb/scancode-toolkit/issues please include:
- Your operating system name, version and architecture (32 or 64 bits).
- Your Python version.
- Your ScanCode version.
- Any additional details about your local setup that might be helpful to diagnose this bug.
- Detailed steps to reproduce the bug, such as the commands you ran and a link to the code you are scanning.
- The errors messages or failure trace if any.
- 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
Documentation can come in the form of wiki pages, docstrings, blog posts, articles, etc. Even a minor typo fix is welcomed.
To set up ScanCode for local development:
Fork the scancode-toolkit on GitHub at https://github.com/nexb/scancode-toolkit/fork
Clone your fork locally:
git clone [email protected]:your_name_here/scancode-toolkit.git
Create a branch for local development:
git checkout -b name-of-your-bugfix-or-feature
Configure your local environment for development, run the configure script. The configure script creates an isolated Python virtual environment in your checkout directory, the Python pip tool, and installs the thirdparty libraries (from the thirdparty/ directory), setup the paths, etc. See https://virtualenv.pypa.io/en/latest/ for more details.
Run this command to configure ScanCode:
source configure
On Windows use instead:
configure
When you create a new terminal/shell to work on ScanCode, either rerun the configure script or source bin/activate (or run bin\activate on Windows)
Now you can make your code changes in your local clone. Please create new unit tests for your code.
When you are done with your changes, run all the tests. Use this command:
py.test
Or use the -n6 option to run on 6 threads in parallel and run tests faster:
py.test -n6
Commit your changes and push your branch to your GitHub fork:
git add . git commit -m "Your detailed description of your changes." git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website for this branch.
If you need a code review or feedback while you are developing the code just create a pull request. You can add new commits to your branch as needed.
For merging, your request would need to:
- Include unit tests that are passing (run
py.test
). - Update documentation as needed for new API, functionality etc.
- Add a note to
CHANGELOG.rst
about the changes. - Add your name to
AUTHORS.rst
.
To run a subset of test functions containing test_myfeature in their name use:
py.test -k test_myfeature
To run the tests from a single test file:
py.test tests/commoncode/test_fileutils.py
To run tests in parallel on eight processors:
py.test -n 8
To run tests verbosely, displaying all print statements to terminal:
py.test -vvs