Thank you for your interest in contributing to uvup! We appreciate your help in making this project better.
- Rust: uvup is written in Rust. Install it from rustup.rs
- uv: Required for testing. Install from astral.sh/uv
- Git: For version control
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/KercyDing/uvup.git cd uvup - Install the project in development mode:
cargo install --path . - Initialize shell integration for testing:
eval "$(uvup init)"
-
Create a new branch for your work:
git checkout -b your-name/feature
-
Make your changes following our coding guidelines
-
Test your changes:
# Run unit tests cargo test # Run clippy for linting cargo clippy -- -D warnings # Check code formatting cargo fmt --check
-
Format your code:
cargo fmt
-
Reinstall to test the binary:
cargo install --path .
uvup uses both unit tests and integration tests:
Unit Tests
- Located in the same files as the code (using
#[cfg(test)]modules) - Test individual functions and modules
- Run with
cargo test
Integration Tests
- Located in
tests/directory - Test complete workflows
- Run with
cargo test --test integration_test
Manual Testing
- Test all commands in your shell:
uvup create test-env uvup list uvup activate test-env uvup deactivate uvup remove test-env
- Test on different shells (Bash, Zsh, Fish, PowerShell if possible)
- Test edge cases (special characters, spaces, etc.)
We follow standard Rust conventions:
- Formatting: Use
rustfmtwith default settings - Linting: All code must pass
cargo clippy -- -D warnings - Naming: Follow Rust naming conventions
- Comments: Write comments in English only
- Documentation: Use rustdoc comments (
///) for public APIs
We use Conventional Commits format:
<type>: <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Test additions or changesrefactor: Code refactoringchore: Maintenance tasksperf: Performance improvements
Examples:
feat: add default environment support
fix: handle spaces in environment names correctly
docs: update installation instructions
test: add integration tests for Windows
A git commit-msg hook is provided to enforce this format.
-
Push your changes to your fork:
git push origin your-name/feature
-
Open a pull request on GitHub
-
Ensure your PR:
- Has a clear title and description
- References any related issues
- Passes all CI checks
- Includes tests for new functionality
- Updates documentation if needed
-
Respond to review feedback
uvup/
├── src/
│ ├── main.rs # Entry point, CLI parsing
│ ├── cli.rs # Command-line argument definitions
│ ├── error.rs # Error types
│ ├── commands/ # Command implementations
│ │ ├── init.rs
│ │ ├── create.rs
│ │ ├── list.rs
│ │ └── remove.rs
│ ├── shell/ # Shell integration
│ │ ├── detect.rs
│ │ ├── bash.rs
│ │ ├── fish.rs
│ │ └── powershell.rs
│ └── env/ # Environment management
│ ├── paths.rs
│ └── manager.rs
├── tests/ # Integration tests
├── ...
- Create a new file in
src/commands/(e.g.,src/commands/your_command.rs) - Implement the command logic with proper error handling
- Export the module in
src/commands/mod.rs - Add the command variant to
Commandsenum insrc/cli.rs - Add routing in
src/main.rs - Write unit tests in the same file
- Add integration tests in
tests/ - Update documentation in README.md
- Create a new hook template in
src/shell/(e.g.,src/shell/nushell.rs) - Add the shell type to
ShellTypeenum insrc/shell/detect.rs - Update the detection logic in
detect_shell() - Export the module in
src/shell/mod.rs - Update
src/commands/init.rsto handle the new shell - Test thoroughly on the target shell
- Update README.md with the new shell support
When reporting bugs or requesting features:
- Search existing issues first
- Use the issue templates if available
- Provide:
- uvup version (
uvup --version) - Operating system and shell
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Error messages or logs
- uvup version (
- README.md: User-facing documentation
- CHANGELOG.md: Version history
- CONTRIBUTING.md:
When making changes, update relevant documentation.
(For maintainers)
- Update version in
Cargo.toml - Update CHANGELOG.md
- Create a git tag:
git tag v0.x.0 - Push tag:
git push origin v0.x.0 - GitHub Actions will build and publish releases
- Be respectful and constructive
- Follow the Rust Code of Conduct
- Help others when you can
- Ask questions when you need help
- Documentation: Start with README.md
- Issues: Search or create an issue on GitHub
- Discussions: Use GitHub Discussions for general questions
- Code and comments: English only
- Commit messages: English only
- Documentation: English (translations welcome)
- Issue discussions: English preferred, but we understand Chinese
By contributing to uvup, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to uvup!