Thank you for your interest in contributing to py2rs! This document provides guidelines for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/py2rs.git - Create a feature branch:
git checkout -b feature/your-feature-name
- Rust 1.70+ (install via rustup)
- Node.js 16+ (for UI development)
- Tauri CLI:
cargo install tauri-cli
cd py2rs
npm install
cargo tauri devpy2rs/
├── src-tauri/ # Rust backend
│ ├── src/
│ │ ├── main.rs # Entry point
│ │ ├── migrate.rs # Migration logic
│ │ └── llm.rs # LLM provider integration
│ └── Cargo.toml
├── ui/ # Frontend
│ ├── index.html
│ ├── app.js
│ ├── style.css
│ └── i18n/ # Translations
└── README.md
- Follow Rust API Guidelines
- Run
cargo fmtbefore committing - Run
cargo clippyand fix all warnings - Add tests for new functionality
- Use modern ES6+ syntax
- Keep functions small and focused
- Comment complex logic
- Test UI changes in both light and dark themes
When adding new UI text:
- Add keys to
ui/i18n/en.json - Add corresponding translations to
ui/i18n/ru.json - Use
data-tattribute in HTML or access viaTobject in JS
- Test your changes: Ensure the app builds and runs without errors
- Write clear commit messages:
- Use present tense: "Add feature" not "Added feature"
- Keep first line under 72 characters
- Reference issues: "Fix #123: Handle empty Python files"
- Update documentation: If you change functionality, update README.md
- Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request: Describe what you changed and why
- One feature per PR: Keep changes focused and atomic
- Describe the change: Explain what you changed, why, and how to test it
- Link related issues: Use "Fixes #123" or "Closes #456"
- Be responsive: Address review feedback promptly
When reporting bugs, please include:
- OS and version (Windows 11, macOS 14, Ubuntu 22.04, etc.)
- py2rs version (from About dialog or
Cargo.toml) - LLM provider (OpenAI, Anthropic, local model, etc.)
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
We welcome feature requests! Please:
- Check existing issues first to avoid duplicates
- Describe the use case clearly
- Explain how it would help you and others
- Consider whether it fits the project's scope
To add support for a new LLM provider:
- Add the provider enum variant in
src-tauri/src/llm.rs - Implement the API call logic in the
call_llmfunction - Add UI options in
ui/index.htmlandui/app.js - Update translations in
ui/i18n/*.json - Document the provider in README.md
- Maintainers will review your PR within 7 days
- Address feedback by pushing new commits to your branch
- Once approved, a maintainer will merge your PR
- Your contribution will be credited in the release notes
If you have questions about contributing, feel free to:
- Open an issue with the "question" label
- Check existing discussions
- Reach out to maintainers
Thank you for making py2rs better! 🚀