|
| 1 | +# Contributing to SafeBox |
| 2 | + |
| 3 | +Thank you for considering contributing! SafeBox welcomes improvements, bug fixes, documentation updates, and feature ideas, especially from Android developers who care about performance and clean architecture. |
| 4 | + |
| 5 | +## Local Setup |
| 6 | + |
| 7 | +```bash |
| 8 | +git clone https://github.com/harrytmthy-dev/safebox.git |
| 9 | +``` |
| 10 | + |
| 11 | +### Update pre-hook path |
| 12 | + |
| 13 | +`scripts/` contains shared pre-hooks for formatting and test validation. To enable it locally: |
| 14 | + |
| 15 | +```bash |
| 16 | +git config --local core.hooksPath scripts |
| 17 | +chmod +x scripts/pre-commit |
| 18 | +chmod +x scripts/pre-push |
| 19 | +``` |
| 20 | + |
| 21 | +### Run Spotless |
| 22 | + |
| 23 | +```bash |
| 24 | +./gradlew spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache |
| 25 | +``` |
| 26 | + |
| 27 | +## Commit & PR Guidelines |
| 28 | + |
| 29 | +- Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) (e.g. `feat:`, `fix:`, `docs:`, `refactor:`). |
| 30 | +- Keep PRs focused and small. |
| 31 | +- If your change affects the public API, update `README.md` or `MIGRATION.md` accordingly. |
| 32 | +- GitHub Actions will automatically run tests and checks upon opening or updating a PR. |
| 33 | +- Ensure all checks pass before merging. |
| 34 | + |
| 35 | +### Creating a PR |
| 36 | + |
| 37 | +1. Fork the repo and create your feature branch (`git checkout -b feature/amazing-feature`) |
| 38 | +2. Push your changes (`git push origin feature/amazing-feature`) |
| 39 | +3. Open a Pull Request against the `main` branch of the original repository |
| 40 | + |
| 41 | +## Testing |
| 42 | + |
| 43 | +Run all tests locally with: |
| 44 | + |
| 45 | +```bash |
| 46 | +./gradlew testDebugUnitTest |
| 47 | +./gradlew connectedAndroidTest |
| 48 | +``` |
| 49 | + |
| 50 | +CI runs instrumented tests automatically on: |
| 51 | +- Android API 26 |
| 52 | +- Android API 34 |
| 53 | + |
| 54 | +## Contributor Etiquette |
| 55 | + |
| 56 | +- Discuss major changes or feature proposals first via [Issues](https://github.com/harrytmthy-dev/safebox/issues). |
| 57 | +- Be respectful during reviews! We're building something safe and friendly. |
| 58 | +- If anything is unclear, don't hesitate to ask! |
| 59 | + |
| 60 | +## Releasing (For Maintainers) |
| 61 | + |
| 62 | +Only maintainers can perform releases: |
| 63 | +- Tag with semantic versioning (`v1.1.0-alpha02`) |
| 64 | +- Update `CHANGELOG.md` |
| 65 | +- Run: `./gradlew publishToMavenCentral --no-configuration-cache` |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +Thanks again for contributing to SafeBox! You're helping shape a faster, safer Android future. |
0 commit comments