Thank you for your interest in contributing to Gõ Nhanh! This guide will help you get started.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/khaphanspace/gonhanh.org/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started
Before diving in, familiarize yourself with the project:Set up development environment
Create a feature branch
feat/add-tone-shortcutfix/chrome-autocompletedocs/update-architecture
Development Workflow
For Rust Core Changes
When modifying the input method engine:All Rust changes must pass
cargo clippy with zero warnings.For macOS UI Changes
When working on the Swift interface:Testing Requirements
All contributions must include appropriate tests.Writing Tests
Gõ Nhanh has 160+ integration tests organized by category:| Category | File | Purpose |
|---|---|---|
| Basic | basic_test.rs | Single keystroke tests |
| Words | word_test.rs | Full Vietnamese words |
| Sentences | sentence_test.rs | Multi-word sequences |
| Behavior | behavior_test.rs | User interactions |
| Issues | common_issues_test.rs | Real bug reproductions |
| Edge Cases | edge_cases_test.rs | Boundary conditions |
Test Example
Running Tests
Code Quality
Before committing, ensure your code meets our standards:Commit Message Format
We follow Conventional Commits specification:Types
| Type | Purpose | Example |
|---|---|---|
feat | New feature | feat(engine): add shortcut expansion |
fix | Bug fix | fix(transform): correct ư placement |
docs | Documentation | docs(api): clarify FFI ownership |
test | Tests | test(validation): add edge cases |
refactor | Code reorganization | refactor(buffer): optimize lookup |
style | Formatting | style(rust): apply cargo fmt |
chore | Build/CI | chore(ci): update workflow |
Examples
Good commit messages:Subject Line Guidelines
- Use imperative mood: “add” not “adds” or “added”
- Lowercase first letter
- No period at the end
- Maximum 50 characters
- Complete this sentence: “If applied, this commit will…”
Pull Request Process
Before Submitting
PR Template
Use this template for your pull request:Review Process
CI checks
Wait for automated checks to complete:
- Code formatting
- Linting
- Test suite
- Build verification
Code Review Guidelines
When reviewing or receiving reviews:For Reviewers
- Be respectful and constructive
- Focus on the code, not the person
- Suggest improvements rather than demanding changes
- Explain the reasoning behind your comments
- Approve when ready, even if you have minor suggestions
For Authors
- Don’t take feedback personally
- Ask for clarification if needed
- Be open to suggestions
- Respond to all comments
- Make requested changes or explain why you disagree
Types of Contributions
There are many ways to contribute:Code Contributions
- Bug fixes: Fix reported issues
- New features: Add requested functionality
- Performance: Optimize slow code paths
- Refactoring: Improve code quality
Non-Code Contributions
- Documentation: Improve guides and API docs
- Testing: Add test cases for edge cases
- Bug reports: Report issues with reproduction steps
- Feature requests: Suggest improvements
- Community support: Help other users
Coding Standards
Follow our detailed Code Standards guide:Rust Standards
- Format with
cargo fmt(enforced) - Zero clippy warnings
- Add rustdoc comments for public APIs
- Use snake_case for functions/variables
- Use CamelCase for types
Swift Standards
- Follow Google Swift Style Guide
- Use camelCase for variables/functions
- Use PascalCase for types/enums
- Add comments for complex logic
FFI Conventions
- Use
#[repr(C)]for all shared structs - Fixed-size types only (u8, u16, u32)
- Match byte layout exactly between Rust and Swift
- Document memory ownership clearly
Need Help?
If you have questions:- Check the documentation
- Search existing GitHub issues
- Open a new issue or discussion
Don’t hesitate to ask questions! We’re here to help.
Recognition
All contributors are recognized in:- CONTRIBUTORS.md
- README.md contributor section
- GitHub contributors page