|
| 1 | +# Contributing to DDEV PHPStan Extension |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the DDEV PHPStan extension! We welcome contributions from the community. |
| 4 | + |
| 5 | +## Ways to Contribute |
| 6 | + |
| 7 | +- **Bug Reports**: Help us identify and fix issues |
| 8 | +- **Feature Requests**: Suggest new features and improvements |
| 9 | +- **Code Contributions**: Submit pull requests with bug fixes or new features |
| 10 | +- **Documentation**: Improve documentation and examples |
| 11 | +- **Testing**: Help test new releases and report issues |
| 12 | + |
| 13 | +## Getting Started |
| 14 | + |
| 15 | +### Prerequisites |
| 16 | + |
| 17 | +- Node.js 18+ and npm |
| 18 | +- VS Code |
| 19 | +- DDEV |
| 20 | +- Git |
| 21 | + |
| 22 | +### Development Setup |
| 23 | + |
| 24 | +1. **Fork and Clone** |
| 25 | + ```bash |
| 26 | + git clone https://github.com/YOUR_USERNAME/vscode-ddev-phpstan.git |
| 27 | + cd vscode-ddev-phpstan |
| 28 | + ``` |
| 29 | + |
| 30 | +2. **Install Dependencies** |
| 31 | + ```bash |
| 32 | + npm install |
| 33 | + ``` |
| 34 | + |
| 35 | +3. **Build the Extension** |
| 36 | + ```bash |
| 37 | + npm run compile |
| 38 | + ``` |
| 39 | + |
| 40 | +4. **Run Tests** |
| 41 | + ```bash |
| 42 | + npm test |
| 43 | + ``` |
| 44 | + |
| 45 | +5. **Open in VS Code** |
| 46 | + ```bash |
| 47 | + code . |
| 48 | + ``` |
| 49 | + |
| 50 | +6. **Start Debugging** |
| 51 | + - Press `F5` to launch Extension Development Host |
| 52 | + - Test your changes in the new VS Code window |
| 53 | + |
| 54 | +### Project Structure |
| 55 | + |
| 56 | +``` |
| 57 | +src/ |
| 58 | +├── extension.ts # Main extension entry point |
| 59 | +├── models/ # Data models and interfaces |
| 60 | +├── services/ # Core business logic |
| 61 | +├── shared/ # Shared utilities and services |
| 62 | +└── test/ # Test files |
| 63 | +``` |
| 64 | + |
| 65 | +## Development Guidelines |
| 66 | + |
| 67 | +### Code Style |
| 68 | + |
| 69 | +- Use TypeScript with strict type checking |
| 70 | +- Follow existing code style and patterns |
| 71 | +- Use meaningful variable and function names |
| 72 | +- Add JSDoc comments for public APIs |
| 73 | + |
| 74 | +### Testing |
| 75 | + |
| 76 | +- Write tests for new features |
| 77 | +- Ensure all tests pass before submitting PR |
| 78 | +- Test with different DDEV setups if possible |
| 79 | + |
| 80 | +### Commits |
| 81 | + |
| 82 | +We follow conventional commits: |
| 83 | + |
| 84 | +- `feat:` New features |
| 85 | +- `fix:` Bug fixes |
| 86 | +- `docs:` Documentation changes |
| 87 | +- `test:` Test additions/changes |
| 88 | +- `refactor:` Code refactoring |
| 89 | +- `chore:` Maintenance tasks |
| 90 | + |
| 91 | +Example: `feat: add auto-detection of PHPStan config files` |
| 92 | + |
| 93 | +## Pull Request Process |
| 94 | + |
| 95 | +1. **Create Feature Branch** |
| 96 | + ```bash |
| 97 | + git checkout -b feature/your-feature-name |
| 98 | + ``` |
| 99 | + |
| 100 | +2. **Make Changes** |
| 101 | + - Write code following our guidelines |
| 102 | + - Add/update tests as needed |
| 103 | + - Update documentation if required |
| 104 | + |
| 105 | +3. **Test Thoroughly** |
| 106 | + ```bash |
| 107 | + npm run compile |
| 108 | + npm run lint |
| 109 | + npm test |
| 110 | + ``` |
| 111 | + |
| 112 | +4. **Commit Changes** |
| 113 | + ```bash |
| 114 | + git add . |
| 115 | + git commit -m "feat: your descriptive commit message" |
| 116 | + ``` |
| 117 | + |
| 118 | +5. **Push and Create PR** |
| 119 | + ```bash |
| 120 | + git push origin feature/your-feature-name |
| 121 | + ``` |
| 122 | + |
| 123 | + Then create a Pull Request on GitHub. |
| 124 | + |
| 125 | +### PR Requirements |
| 126 | + |
| 127 | +- [ ] All tests pass |
| 128 | +- [ ] Code follows project style |
| 129 | +- [ ] Documentation updated (if needed) |
| 130 | +- [ ] CHANGELOG.md updated (for notable changes) |
| 131 | +- [ ] PR description explains the change |
| 132 | + |
| 133 | +## Issue Guidelines |
| 134 | + |
| 135 | +### Bug Reports |
| 136 | + |
| 137 | +Please use the bug report template and include: |
| 138 | + |
| 139 | +- Extension version |
| 140 | +- VS Code version |
| 141 | +- DDEV version |
| 142 | +- PHPStan version |
| 143 | +- Operating system |
| 144 | +- Clear reproduction steps |
| 145 | +- Expected vs actual behavior |
| 146 | +- Logs/error messages |
| 147 | + |
| 148 | +### Feature Requests |
| 149 | + |
| 150 | +Please use the feature request template and include: |
| 151 | + |
| 152 | +- Clear description of the problem |
| 153 | +- Proposed solution |
| 154 | +- Use case and examples |
| 155 | +- Priority level |
| 156 | + |
| 157 | +## Code of Conduct |
| 158 | + |
| 159 | +### Our Standards |
| 160 | + |
| 161 | +- Be respectful and inclusive |
| 162 | +- Focus on constructive feedback |
| 163 | +- Help others learn and grow |
| 164 | +- Maintain professional communication |
| 165 | + |
| 166 | +### Unacceptable Behavior |
| 167 | + |
| 168 | +- Harassment or discrimination |
| 169 | +- Trolling or inflammatory comments |
| 170 | +- Personal attacks |
| 171 | +- Publishing private information |
| 172 | + |
| 173 | +## Getting Help |
| 174 | + |
| 175 | +- **Questions**: Open a discussion on GitHub |
| 176 | +- **Issues**: Use the issue templates |
| 177 | +- **Chat**: Contact the maintainers |
| 178 | + |
| 179 | +## License |
| 180 | + |
| 181 | +By contributing, you agree that your contributions will be licensed under the GPL-3.0 License. |
| 182 | + |
| 183 | +## Recognition |
| 184 | + |
| 185 | +Contributors will be recognized in: |
| 186 | +- CHANGELOG.md for notable contributions |
| 187 | +- GitHub contributors page |
| 188 | +- Release notes for significant features |
| 189 | + |
| 190 | +Thank you for contributing to make the DDEV PHPStan extension better! 🚀 |
0 commit comments