Thank you for your interest in contributing to ZenLock! This document provides guidelines and instructions for contributing to the project.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors. We expect:
- Professional and constructive communication
- Respect for differing viewpoints and experiences
- Acceptance of constructive criticism
- Focus on what is best for the community
Before submitting a bug report:
- Check the existing issues to avoid duplicates
- Use the latest version of the app
- Collect relevant information (Android version, device model, logs)
When submitting a bug report, include:
- Clear and descriptive title
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Screenshots or logs if applicable
- Device information and Android version
Feature suggestions are welcome! Please:
- Check existing feature requests first
- Provide a clear use case for the feature
- Explain how it aligns with ZenLock's focus on productivity
- Consider implementation complexity and user experience
# Fork and clone the repository
git clone https://github.com/HumbleBee14/ZenLock.git
cd ZenLock
# Create a branch using the required naming pattern
git checkout -b feat/your-feature-nameBranch names must follow this pattern (enforced by CI):
<type>/<short-description>
Allowed types: feat, fix, chore, docs, refactor, test, perf
Examples:
feat/lock-until-timefix/notification-crash-android14docs/update-readme
PRs from branches not matching this pattern will fail CI and be closed.
- Write clean, readable code following the project's style
- Add comments for complex logic
- Update documentation if needed
- Test thoroughly on multiple Android versions if possible
Java Conventions:
- Use 4 spaces for indentation
- Follow standard Java naming conventions:
- Classes:
PascalCase - Methods/variables:
camelCase - Constants:
UPPER_SNAKE_CASE
- Classes:
- Maximum line length: 120 characters
- Add JavaDoc comments for public methods
Example:
/**
* Manages focus session scheduling and execution.
*
* @param context Application context
* @param duration Session duration in milliseconds
* @return true if session started successfully
*/
public boolean startFocusSession(Context context, long duration) {
// Implementation
}Write clear, descriptive commit messages:
feat: Add support for multi-partner accountability system
^--^ ^--------------------------------------------^
| |
| +-> Summary in present tense
|
+-------> Type: feat, fix, docs, style, refactor, test, chore
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Automated version bumping uses these prefixes:
feat:triggers a minor version bump (e.g., 1.8.3 to 1.9.0)fix:,chore:, and others trigger a patch bump (e.g., 1.8.3 to 1.8.4)- Include
BREAKING CHANGEin the commit body for a major bump (e.g., 1.8.3 to 2.0.0)
Before submitting:
- Test on at least one physical device
- Verify all permissions work correctly
- Test focus session start/stop cycles
- Verify SMS functionality if modified
- Check for memory leaks in long-running sessions
-
Push your changes to your fork
git push origin feat/your-feature-name
-
Open a pull request with:
- Clear title and description
- Reference to related issues
- Screenshots/videos for UI changes
- Test results and device information
-
Respond to review feedback promptly
ZenLock follows a modular architecture:
- Activities: UI layer and user interaction
- Services: Background operations (AccessibilityService, ForegroundService)
- Utils: Helper classes for specific functionality
- Fragments: Reusable UI components
Good First Issues:
- UI improvements and bug fixes
- Documentation enhancements
- Adding unit tests
- Localization support
Advanced Contributions:
- Performance optimizations
- New focus modes or features
- Analytics integration
- Cloud sync capabilities
When contributing:
- Never log sensitive information (phone numbers, OTP codes)
- Use ProGuard rules for new sensitive classes
- Follow Android security best practices
- Request permissions appropriately
Adding new dependencies:
- Justify the need in your PR description
- Use AndroidX libraries when possible
- Check license compatibility (prefer Apache 2.0, MIT)
- Update
build.gradle.ktsand documentation
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk# Unit tests
./gradlew test
# Instrumentation tests (requires connected device)
./gradlew connectedAndroidTest# Lint checks
./gradlew lint
# View lint report
open app/build/reports/lint-results.htmlUpdate documentation when:
- Adding new features
- Changing existing functionality
- Adding new configuration options
- Modifying build process
Need assistance?
- Ask questions in GitHub Discussions
- Review existing issues and PRs
- Check the README for project overview
To enforce the workflows above, the main branch should have these protections enabled in GitHub (Settings > Branches > Add rule for main):
- Require a pull request before merging (no direct pushes to main)
- Require status checks to pass before merging: check
PR Validation - Require branches to be up to date before merging
- Require linear history (forces squash or rebase merge)
- Do not allow bypassing the above settings (even for admins, optional but recommended)
This guarantees:
- Nobody can push directly to main
- Every change goes through a PR with validated branch name, title, and description
- The auto version-bump workflow always runs on a clean, up-to-date main
By contributing, you agree that your contributions will be licensed under the MIT License.
Contributors are recognized in:
- GitHub contributors list
- Release notes for significant contributions
- Project documentation
Thank you for helping make ZenLock better!