|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +Welcome! We’re glad you’re interested in contributing to projects like ScanCode.io, VulnerableCode, and DejaCode. |
| 4 | +This guide covers the basics to help you get started quickly and smoothly. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 1. Getting Started |
| 9 | + |
| 10 | +1. **Find or open an issue** |
| 11 | + Check the issue tracker for existing discussions. |
| 12 | + If you plan a larger change or new feature, please open an issue first so we can align on the approach. |
| 13 | + |
| 14 | +2. **Fork and clone the repository** |
| 15 | + Fork the repo on GitHub and clone your fork locally. |
| 16 | + |
| 17 | +3. **Create a new branch** |
| 18 | + Use a short, descriptive branch name such as: |
| 19 | + - `fix/update-readme` |
| 20 | + - `feature/new-api-endpoint` |
| 21 | + |
| 22 | +4. **Develop and test locally** |
| 23 | + Write your code and make sure tests pass before opening a Pull Request. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 2. Code Quality and Standards |
| 28 | + |
| 29 | +### 2.1. Code Style |
| 30 | + |
| 31 | +Most AboutCode repositories use **PEP8** conventions. Tools like **Black** and **isort** are commonly used for formatting and import sorting. |
| 32 | + |
| 33 | +To format your code automatically, many projects support: |
| 34 | + |
| 35 | +```bash |
| 36 | +make valid |
| 37 | +``` |
| 38 | + |
| 39 | +### 2.2. pre-commit Hooks (Optional but Recommended) |
| 40 | + |
| 41 | +If the repository includes a `.pre-commit-config.yaml`, you can enable automatic checks to run before every commit: |
| 42 | + |
| 43 | +```bash |
| 44 | +pip install pre-commit |
| 45 | +pre-commit install |
| 46 | +``` |
| 47 | + |
| 48 | +This helps catch formatting and simple issues early. |
| 49 | + |
| 50 | +### 2.3. Developer Certificate of Origin (DCO) |
| 51 | + |
| 52 | +All contributions require a DCO sign-off. |
| 53 | +Add this automatically by committing with: |
| 54 | + |
| 55 | +```bash |
| 56 | +git commit -s |
| 57 | +``` |
| 58 | + |
| 59 | +Each commit message must include a line like: |
| 60 | + |
| 61 | +``` |
| 62 | +Signed-off-by: Your Name <[email protected]> |
| 63 | +``` |
| 64 | + |
| 65 | +### 2.4. Tests |
| 66 | + |
| 67 | +If you fix a bug, add a test that fails before your change and passes afterward. |
| 68 | +If you introduce a new feature, include tests that cover the new functionality. |
| 69 | + |
| 70 | +Run the full test suite locally: |
| 71 | + |
| 72 | +```bash |
| 73 | +make test |
| 74 | +``` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## 3. Submitting Your Pull Request |
| 79 | + |
| 80 | +When your branch is ready: |
| 81 | + |
| 82 | +1. Push it to your fork. |
| 83 | +2. Open a Pull Request against the main branch of the original repository. |
| 84 | + |
| 85 | +A helpful PR includes: |
| 86 | + |
| 87 | +- [ ] **Linked Issue** (e.g., “Fixes #123”) |
| 88 | +- [ ] **Passing Tests** (local + CI) |
| 89 | +- [ ] **DCO Signed** on all commits |
| 90 | +- [ ] **Changelog/Docs Updated** if the change affects behavior |
| 91 | + |
| 92 | +Thanks for contributing! We appreciate your time and effort. |
0 commit comments