|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +Thank you for your interest in contributing to this project! This guide will |
| 4 | +help you get started with contributing effectively. |
| 5 | + |
| 6 | +## Getting Started |
| 7 | + |
| 8 | +1. Fork the repository and clone your fork: |
| 9 | + |
| 10 | + ```bash |
| 11 | + gh repo clone dreadnode/AIRTBench-Code |
| 12 | + cd AIRTBench-Code |
| 13 | + ``` |
| 14 | + |
| 15 | +1. Set up your development environment with your preferred package manager: |
| 16 | + |
| 17 | + ```bash |
| 18 | + # Using pip |
| 19 | + python -m venv .venv |
| 20 | + source .venv/bin/activate # On Windows: .venv\Scripts\activate |
| 21 | + pip install -r requirements.txt |
| 22 | + |
| 23 | + # Using uv |
| 24 | + uv venv |
| 25 | + source .venv/bin/activate |
| 26 | + uv pip install -r requirements.txt |
| 27 | + |
| 28 | + # Using poetry |
| 29 | + poetry install |
| 30 | + ``` |
| 31 | + |
| 32 | +1. Install and configure pre-commit hooks: |
| 33 | + |
| 34 | + ```bash |
| 35 | + pre-commit install |
| 36 | + ``` |
| 37 | + |
| 38 | +1. Create a new branch for your contribution: |
| 39 | + |
| 40 | + ```bash |
| 41 | + git checkout -b your-feature-name |
| 42 | + ``` |
| 43 | + |
| 44 | +## Development Process |
| 45 | + |
| 46 | +### Code Quality Checks |
| 47 | + |
| 48 | +Before submitting your changes, ensure all quality checks pass: |
| 49 | + |
| 50 | +```bash |
| 51 | +# Run all checks at once |
| 52 | +task check |
| 53 | + |
| 54 | +# Or run individual checks: |
| 55 | +task format # Code formatting with Black |
| 56 | +task lint # Linting with Ruff |
| 57 | +task types # Type checking with mypy |
| 58 | +task test # Run tests with pytest |
| 59 | +``` |
| 60 | + |
| 61 | +The pre-commit hooks will automatically run most checks when you commit changes. |
| 62 | + |
| 63 | +### Documentation |
| 64 | + |
| 65 | +- Add documentation for new features in the `docs/` directory |
| 66 | +- Update existing documentation to reflect your changes |
| 67 | + |
| 68 | +### Commit Messages |
| 69 | + |
| 70 | +Follow [Conventional Commits](https://www.conventionalcommits.org/) for your |
| 71 | +commit messages: |
| 72 | + |
| 73 | +```bash |
| 74 | +# Format: <type>: <description> |
| 75 | +feat: add new template feature |
| 76 | +fix: resolve issue with pytest config |
| 77 | +docs: improve setup instructions |
| 78 | +ci: update GitHub Actions workflow |
| 79 | +``` |
| 80 | + |
| 81 | +Common types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `ci`, `chore` |
| 82 | + |
| 83 | +## Pull Request Process |
| 84 | + |
| 85 | +1. Update your branch with the latest changes: |
| 86 | + |
| 87 | + ```bash |
| 88 | + git fetch origin |
| 89 | + git rebase origin/main |
| 90 | + ``` |
| 91 | + |
| 92 | +1. Push your changes: |
| 93 | + |
| 94 | + ```bash |
| 95 | + git push origin your-feature-name |
| 96 | + ``` |
| 97 | + |
| 98 | +1. Create a pull request with: |
| 99 | + |
| 100 | + - Clear, descriptive title following conventional commits |
| 101 | + - Detailed description of changes |
| 102 | + - Links to related issues |
| 103 | + - Screenshots for UI changes (if applicable) |
| 104 | + - Documentation updates |
| 105 | + - Template updates (if required) |
| 106 | + |
| 107 | +1. Address any review feedback and update your PR |
| 108 | + |
| 109 | +## Code Standards |
| 110 | + |
| 111 | +- Follow the existing code style (enforced by Black and Ruff) |
| 112 | +- Maintain type hints and add new ones for your code |
| 113 | +- Write clear docstrings for new functions and classes |
| 114 | +- Add tests for new features or bug fixes |
| 115 | +- Keep changes focused and atomic |
| 116 | +- Update example code if needed |
| 117 | + |
| 118 | +## Project Structure |
| 119 | + |
| 120 | +When adding new features, follow the project structure: |
| 121 | + |
| 122 | +```bash |
| 123 | +. |
| 124 | +├── docs/ # Documentation |
| 125 | +├── examples/ # Usage examples |
| 126 | +├── tests/ # Test suite |
| 127 | +└── pyproject.toml # Project configuration |
| 128 | +``` |
| 129 | + |
| 130 | +## Getting Help |
| 131 | + |
| 132 | +- Check existing issues and pull requests |
| 133 | +- Open a new issue for: |
| 134 | + |
| 135 | + 1. Bug reports |
| 136 | + 1. Feature requests |
| 137 | + 1. Questions about the template |
| 138 | + 1. Contributing questions |
| 139 | + |
| 140 | +We aim to respond to all issues promptly. |
0 commit comments