|
| 1 | +# Contributing to RAZ |
| 2 | + |
| 3 | +Thank you for your interest in contributing to RAZ! This guide will help you report issues and contribute effectively. |
| 4 | + |
| 5 | +## 🐛 Reporting Issues |
| 6 | + |
| 7 | +We have specific issue templates to help you provide the right information: |
| 8 | + |
| 9 | +### Choose the Right Template |
| 10 | + |
| 11 | +- **🐛 [Bug Report](https://github.com/raz-rs/raz/issues/new?template=bug_report.md)** - General bugs and unexpected behavior |
| 12 | +- **⚡ [Override Issue](https://github.com/raz-rs/raz/issues/new?template=override_issue.md)** - Problems with saving, loading, or applying overrides |
| 13 | +- **🔍 [Command Detection](https://github.com/raz-rs/raz/issues/new?template=command_detection.md)** - Wrong commands generated or project type detection issues |
| 14 | +- **🆚 [VS Code Extension](https://github.com/raz-rs/raz/issues/new?template=vscode_extension.md)** - Extension-specific problems |
| 15 | +- **🐌 [Performance Issue](https://github.com/raz-rs/raz/issues/new?template=performance.md)** - Slow performance or resource usage problems |
| 16 | +- **✨ [Feature Request](https://github.com/raz-rs/raz/issues/new?template=feature_request.md)** - New features or enhancements |
| 17 | + |
| 18 | +### Essential Information for Bug Reports |
| 19 | + |
| 20 | +When reporting any issue, please include: |
| 21 | + |
| 22 | +1. **Complete terminal output** - Copy the entire output including the command being executed |
| 23 | +2. **Exact reproduction steps** - We need to be able to reproduce the issue |
| 24 | +3. **Environment details** - OS, VS Code version, Rust version, etc. |
| 25 | +4. **Project context** - Cargo.toml, file structure, cursor position |
| 26 | + |
| 27 | +### 📋 Terminal Output Format |
| 28 | + |
| 29 | +Always include the complete terminal output in this format: |
| 30 | + |
| 31 | +``` |
| 32 | +* Executing task: /Users/username/.cargo/bin/raz "/path/to/file.rs:line:column" |
| 33 | +
|
| 34 | +[Complete output including any errors, warnings, and the actual command executed] |
| 35 | +``` |
| 36 | + |
| 37 | +This output contains crucial debugging information: |
| 38 | +- The exact command being executed |
| 39 | +- File path and cursor position |
| 40 | +- Any detected overrides |
| 41 | +- Error messages and exit codes |
| 42 | + |
| 43 | +## 🔧 Getting Help |
| 44 | + |
| 45 | +### Before Opening an Issue |
| 46 | + |
| 47 | +1. **Check existing issues** - Your issue might already be reported |
| 48 | +2. **Read the documentation** - Check the [README](../README.md) and [docs](../docs/) |
| 49 | +3. **Try with latest version** - Run `raz --version` and compare with latest release |
| 50 | +4. **Test with minimal example** - Can you reproduce with a simple test case? |
| 51 | + |
| 52 | +### Quick Debugging Steps |
| 53 | + |
| 54 | +1. **Test the binary directly:** |
| 55 | + ```bash |
| 56 | + raz --version |
| 57 | + raz "/path/to/file.rs:line:column" --dry-run |
| 58 | + ``` |
| 59 | + |
| 60 | +2. **Check saved overrides:** |
| 61 | + ```bash |
| 62 | + raz override list |
| 63 | + ``` |
| 64 | + |
| 65 | +3. **Enable debug logging:** |
| 66 | + ```bash |
| 67 | + RUST_LOG=debug raz "/path/to/file.rs:line:column" |
| 68 | + ``` |
| 69 | + |
| 70 | +4. **VS Code troubleshooting:** |
| 71 | + - Check the RAZ output channel (View → Output → RAZ) |
| 72 | + - Try restarting VS Code |
| 73 | + - Test with other extensions disabled |
| 74 | + |
| 75 | +## 🏗️ Development |
| 76 | + |
| 77 | +### Setting Up Development Environment |
| 78 | + |
| 79 | +1. **Clone the repository:** |
| 80 | + ```bash |
| 81 | + git clone https://github.com/raz-rs/raz.git |
| 82 | + cd raz |
| 83 | + ``` |
| 84 | + |
| 85 | +2. **Install dependencies:** |
| 86 | + ```bash |
| 87 | + # Rust toolchain (if not already installed) |
| 88 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 89 | + |
| 90 | + # Build the project |
| 91 | + cargo build |
| 92 | + ``` |
| 93 | + |
| 94 | +3. **Run tests:** |
| 95 | + ```bash |
| 96 | + cargo test |
| 97 | + ``` |
| 98 | + |
| 99 | +4. **Install locally for testing:** |
| 100 | + ```bash |
| 101 | + cargo install --path raz-adapters/cli |
| 102 | + ``` |
| 103 | + |
| 104 | +### Project Structure |
| 105 | + |
| 106 | +``` |
| 107 | +raz/ |
| 108 | +├── raz-common/ # Shared utilities |
| 109 | +├── raz-config/ # Configuration management |
| 110 | +├── raz-core/ # Core command generation logic |
| 111 | +├── raz-override/ # Override system |
| 112 | +├── raz-validation/ # Input validation |
| 113 | +├── raz-adapters/ |
| 114 | +│ ├── cli/ # Command-line interface |
| 115 | +│ └── vscode/ # VS Code extension |
| 116 | +├── docs/ # Documentation |
| 117 | +└── tests/ # Integration tests |
| 118 | +``` |
| 119 | + |
| 120 | +### Testing Your Changes |
| 121 | + |
| 122 | +1. **Unit tests:** |
| 123 | + ```bash |
| 124 | + cargo test --workspace |
| 125 | + ``` |
| 126 | + |
| 127 | +2. **Integration tests:** |
| 128 | + ```bash |
| 129 | + cargo test --package raz-core |
| 130 | + ``` |
| 131 | + |
| 132 | +3. **Manual testing:** |
| 133 | + ```bash |
| 134 | + # Build and install locally |
| 135 | + cargo build --release |
| 136 | + cp target/release/raz ~/.cargo/bin/ |
| 137 | + |
| 138 | + # Test with various project types |
| 139 | + raz "/path/to/test/file.rs:line:column" |
| 140 | + ``` |
| 141 | + |
| 142 | +4. **VS Code extension testing:** |
| 143 | + - Open the `raz-adapters/vscode` folder in VS Code |
| 144 | + - Press F5 to launch Extension Development Host |
| 145 | + - Test the extension in the new window |
| 146 | + |
| 147 | +### Pull Request Guidelines |
| 148 | + |
| 149 | +1. **Create focused PRs** - One feature or fix per PR |
| 150 | +2. **Add tests** - Include tests for new functionality |
| 151 | +3. **Update documentation** - Update README or docs if needed |
| 152 | +4. **Follow code style** - Run `cargo fmt` and `cargo clippy` |
| 153 | +5. **Write good commit messages** - Be descriptive and concise |
| 154 | + |
| 155 | +### Code Style |
| 156 | + |
| 157 | +- **Rust code:** Follow standard Rust conventions |
| 158 | +- **Use `cargo fmt`** - Format code before committing |
| 159 | +- **Use `cargo clippy`** - Fix any warnings |
| 160 | +- **Document public APIs** - Add doc comments for public functions |
| 161 | +- **Add tests** - Especially for new features and bug fixes |
| 162 | + |
| 163 | +## 🤝 Community |
| 164 | + |
| 165 | +- **Discussions:** [GitHub Discussions](https://github.com/raz-rs/raz/discussions) |
| 166 | +- **Issues:** Use the appropriate issue template |
| 167 | +- **Discord/Chat:** [Link if available] |
| 168 | + |
| 169 | +## 📄 License |
| 170 | + |
| 171 | +By contributing to RAZ, you agree that your contributions will be licensed under the same license as the project. |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +Thank you for helping make RAZ better! 🚀 |
0 commit comments