Contributing to Hayasen
Contributions are welcome for the hayasen project! To ensure a smooth and effective collaboration, please follow these guidelines.
Getting Started
- Fork the repository: Start by forking the
hayasenrepository to your GitHub account. - Clone your fork: Clone your forked repository to your local machine:
git clone https://github.com/Vaishnav-Sabari-Girish/hayasen.git cd hayasen - Create a new branch: For each new feature or bug fix, create a new branch:
git checkout -b feature/your-feature-name # For new features git checkout -b bugfix/your-bug-name # For bug fixes
Code Style Guidelines (Rust)
Please adhere to the existing code style and conventions of the project, as enforced by cargo fmt and cargo clippy.
- Imports: Prefer
use crate::module::item;oruse super::item;for internal modules. Group related imports. - Formatting: Adhere to
cargo fmtstandards. You can runcargo fmtto automatically format your code. - Naming Conventions:
snake_casefor functions, variables, and modules.PascalCasefor types (structs, enums, traits).SCREAMING_SNAKE_CASEfor constants.
- Error Handling: Utilize
ResultandOptiontypes for explicit error handling. Avoidunwrap()andexpect()in production code. - Types: Use explicit types where clarity is enhanced, otherwise let type inference work.
- Comments: Explain why complex logic is implemented, not what it does.
Development Workflow
Building the Project
- Build:
cargo build - Build (release):
cargo build --release
Testing
- Run all tests:
cargo test - Run a single test:
cargo test -- <test_name>
Linting and Type Checking
- Linting:
cargo clippy -- -D warnings - Check types:
cargo check
Submitting Changes
- Commit your changes: Write clear, concise commit messages that explain the purpose of your changes.
- Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request:
- Go to the original
hayasenrepository on GitHub. - Click on "New Pull Request".
- Provide a descriptive title and a detailed explanation of your changes.
- Ensure all tests pass and linting checks are clear.
- Go to the original
Thank you for contributing to Hayasen!