Setting Up Development Environment
Prerequisites
Ensure you have the following installed:-
Rust (latest stable version)
-
Git
Clone and Build
- Fork the repository on GitHub
-
Clone your fork:
-
Build the project:
-
Run the development build:
Development Workflow
Running Tests
Run the test suite:Code Formatting
The project usesrustfmt for consistent code formatting:
Linting
The project uses Clippy for linting (note the#![warn(clippy::all)] in src/main.rs:1):
Running in Development Mode
For development, usecargo run with arguments:
Coding Standards
Rust Style Guidelines
- Follow Rust conventions: Use
cargo fmtto ensure consistent formatting - Use meaningful names: Variables, functions, and types should have descriptive names
- Write documentation: Add doc comments (
///) for public APIs - Handle errors properly: Use
Resulttypes and the?operator for error propagation - Avoid unwrap(): Prefer pattern matching or
?operator for error handling
Code Organization
- Keep modules focused on a single responsibility
- Use
pubonly for items that need to be public - Group related functionality together
- Add comments for complex logic
Example Code Style
Testing Your Changes
Manual Testing Checklist
Before submitting a PR, test the following scenarios:- Download a single file
- Download a directory
- Download a repository root
- Download with
-zflag (zipped output) - Download multiple URLs (comma-separated)
- Download to custom path
- Test with invalid URLs
- Test with non-existent repositories
- Test with private repositories (using
GITHUB_TOKEN)
Environment Variables
Test with GitHub authentication:Submitting Changes
Creating a Pull Request
-
Create a feature branch:
-
Make your changes and commit them:
-
Run tests and checks:
-
Push to your fork:
-
Open a Pull Request on GitHub:
- Provide a clear title and description
- Reference any related issues
- Explain what your changes do and why
Commit Message Guidelines
- Use present tense (“Add feature” not “Added feature”)
- Use imperative mood (“Move cursor to…” not “Moves cursor to…”)
- First line should be a brief summary (50 characters or less)
- Add detailed description if necessary
Getting Help
- Issues: Check existing issues on GitHub before creating new ones
- Discussions: Use GitHub Discussions for questions and ideas
- Code Review: Be open to feedback during the PR review process
License
By contributing to cloneit, you agree that your contributions will be licensed under the MIT License.Code of Conduct
- Be respectful and constructive in discussions
- Welcome newcomers and help them get started
- Focus on what is best for the community
- Show empathy towards other community members