Contributing Guide
Relevant source files
The following files were used as context for generating this wiki page:This guide provides instructions and guidelines for contributing to the VoiceInk project. The goal is to make VoiceInk the most efficient and privacy-focused voice-to-text solution for macOS. All contributions should align with this vision.
Before starting any work, it is crucial to read this guide, particularly the policies on proposing changes. For detailed instructions on setting up the development environment and compiling the application, please refer to the Building Guide.
Sources: README.md:18-21, CONTRIBUTING.md:3-4, CONTRIBUTING.md:25-26
Code of Conduct
All participants in the VoiceInk project are expected to adhere to the Contributor Covenant Code of Conduct. The community is pledged to be a harassment-free, open, welcoming, and inclusive environment for everyone.
Our Pledge
Contributors pledge to act and interact in ways that contribute to a healthy community. This includes being respectful, demonstrating empathy, and accepting constructive feedback gracefully.
Sources: CODE_OF_CONDUCT.md:5-13
Unacceptable Behavior
Examples of unacceptable behavior include:
- The use of sexualized language or imagery.
- Trolling, insulting comments, and personal or political attacks.
- Public or private harassment.
- Publishing others' private information without permission.
- Any conduct considered inappropriate in a professional setting.
Instances of unacceptable behavior should be reported to the community leaders for enforcement.
Sources: CODE_OF_CONDUCT.md:26-34, CODE_OF_CONDUCT.md:42-44
Getting Started: Building from Source
To contribute, you must first build the project from its source code. This involves setting up the necessary prerequisites and compiling both the whisper.cpp dependency and the main VoiceInk application.
Sources: BUILDING.md
Prerequisites
Ensure your development environment meets the following requirements:
| Component | Version |
|---|---|
| macOS | 14.0 or later |
| Xcode | Latest version recommended |
| Swift | Latest version recommended |
Sources: BUILDING.md:7-10, CONTRIBUTING.md:52-55
Build Process
The build process involves two main stages: building the whisper.xcframework and then building the VoiceInk application itself.
The following diagram illustrates the high-level build workflow.
Sources: BUILDING.md:12-29
Step 1: Build whisper.cpp Framework
VoiceInk depends on whisper.cpp for transcription. You must first clone and build its XCFramework.
git clone https://github.com/ggerganov/whisper.cpp.git
cd whisper.cpp
./build-xcframework.sh
This script will generate the required framework at build-apple/whisper.xcframework.
Sources: BUILDING.md:13-18
Step 2: Build VoiceInk
After building the dependency, clone the VoiceInk repository and integrate the framework.
- Clone the VoiceInk repository:
git clone https://github.com/Beingpax/VoiceInk.git cd VoiceInk - Add
whisper.xcframeworkto the Xcode project by dragging it into the project navigator or adding it under "Frameworks, Libraries, and Embedded Content". - Build and run the project in Xcode using
Cmd+BandCmd+R.
Sources: BUILDING.md:21-29
Contribution Workflow
To ensure contributions align with the project's direction and maintain code quality, a specific workflow must be followed. The acceptance of any Pull Request is at the sole discretion of the project maintainers.
Sources: CONTRIBUTING.md:8-9
Proposing Changes
This is the most critical step. Before writing any code for significant changes, major features, or architectural modifications, you must:
- Open an issue to discuss the proposed changes.
- Wait for feedback and approval from the project maintainers.
This policy prevents wasted effort and ensures your work aligns with the project's roadmap.
Sources: CONTRIBUTING.md:10-16, CONTRIBUTING.md:24-31
The following diagram shows the required communication flow for new contributions.
Sources: CONTRIBUTING.md:10-16
Types of Contributions
Bug Reports
- Check for existing reports before creating a new one.
- Use the bug report template.
- Include detailed information and steps to reproduce the issue.
Sources: CONTRIBUTING.md:35-39
Enhancement Suggestions
- Use the feature request template.
- Clearly describe the feature and its benefits.
- Discuss potential implementation approaches.
Sources: CONTRIBUTING.md:41-45
Pull Request Process
Once your proposed changes have been approved and implemented, follow the standard Git workflow to submit them.
The diagram below outlines the required steps for submitting a Pull Request.
Sources: CONTRIBUTING.md:47-50
A typical pull request submission involves these commands:
git checkout -b feature/amazing-featuregit commit -m 'Add some amazing feature'git push origin feature/amazing-feature
Sources: CONTRIBUTING.md:48-50
Development and Style Guidelines
To maintain a consistent and high-quality codebase, all contributions must adhere to the project's development standards.
Sources: CONTRIBUTING.md:57-58
Coding Standards
- Follow Swift style guidelines.
- Use meaningful and self-documenting names for variables and functions.
- Keep functions focused and concise.
- Write meaningful commit messages.
- Add comments to explain complex logic.
Sources: CONTRIBUTING.md:58-62, CONTRIBUTING.md:67-71
Testing
- All existing tests must pass before submitting a pull request.
- New features must be accompanied by new tests.
Sources: CONTRIBUTING.md:64-66
Community and Support
If you have questions or need clarification, you can:
- Open an issue.
- Start a discussion.
- Reach out to the maintainers.
The project also encourages community engagement through discussions and helping other contributors.
Sources: CONTRIBUTING.md:73-82, README.md:92-97