Thank you for your interest in contributing to Kurrency! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Testing Guidelines
- Commit Message Guidelines
- Pull Request Process
- Reporting Bugs
- Suggesting Features
By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/Kurrency.git cd Kurrency - Add the upstream repository:
git remote add upstream https://github.com/Kimplify/Kurrency.git
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
- JDK 17 or higher
- Android SDK (API 24+)
- Xcode (for iOS development, macOS only)
- Kotlin 2.3.0+
- Gradle 8.0+
./gradlew build# Run all tests
./gradlew allTests
# Run tests for specific module
./gradlew :kurrency-core:test
./gradlew :kurrency-compose:test
./gradlew :kurrency-deci:test
# Run Android instrumented tests
./gradlew :kurrency-core:connectedAndroidTest# Android
./gradlew :sample:installDebug
# Desktop (JVM)
./gradlew :sample:run
# iOS (requires macOS and Xcode)
# Open sample/iosApp in Xcode and runWe welcome:
- Bug fixes - Fix issues in existing functionality
- New features - Add new currency formatting capabilities
- Platform support - Improve or extend platform-specific implementations
- Documentation - Improve README, KDoc, or examples
- Tests - Add or improve test coverage
- Performance improvements - Optimize formatting operations
- Locale support - Add support for additional locales
- Check existing issues and pull requests
- For major changes, open an issue first to discuss your approach
- Make sure tests pass locally before submitting a PR
We follow the Kotlin Coding Conventions:
- Use 4 spaces for indentation (no tabs)
- Maximum line length: 120 characters
- Use camelCase for functions and properties
- Use PascalCase for classes and interfaces
- Avoid unnecessary comments - code should be self-documenting
- All public APIs must have KDoc documentation
- Include examples in KDoc for non-trivial APIs
- Document when functions throw exceptions or return Result types
- Explain platform-specific behavior in platform implementation files
/**
* Formats a currency amount using the specified locale.
*
* @param amount The amount to format as a string
* @param currencyCode ISO 4217 currency code (e.g., "USD", "EUR")
* @return Result containing formatted string, or error if formatting fails
*
* Example:
* ```kotlin
* val formatted = formatter.formatCurrencyStyleResult("1234.56", "USD")
* .getOrNull() // "$1,234.56" in en-US locale
* ```
*/
fun formatCurrencyStyleResult(amount: String, currencyCode: String): Result<String>- All new features must include tests
- Bug fixes should include regression tests
- Aim for high test coverage (minimum 80% for new code)
- Test edge cases: empty strings, invalid input, boundary values
class CurrencyFormatterTest {
@Test
fun formatCurrencyStyle_withValidInput_returnsFormattedString() {
val formatter = CurrencyFormatter(KurrencyLocale.US)
val result = formatter.formatCurrencyStyleResult("1234.56", "USD")
assertTrue(result.isSuccess)
assertEquals("$1,234.56", result.getOrNull())
}
@Test
fun formatCurrencyStyle_withInvalidCurrency_returnsError() {
val formatter = CurrencyFormatter(KurrencyLocale.US)
val result = formatter.formatCurrencyStyleResult("1234.56", "INVALID")
assertTrue(result.isFailure)
assertTrue(result.exceptionOrNull() is KurrencyError.InvalidCurrencyCode)
}
}- Add common tests in
commonTest/ - Add platform-specific tests in
androidInstrumentedTest/,iosTest/, etc. - Verify behavior across all supported platforms
We follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringperf: Performance improvementschore: Build process or tooling changes
feat(compose): Add rememberSystemCurrencyFormatter composable
Implement new composable function that automatically uses system locale
for currency formatting. Includes reactive updates when system locale changes.
Closes #42
fix(android): Add infinity/NaN validation to formatter
Android formatter was missing finite number validation present in other
platforms. This could cause incorrect formatting of edge case values.
-
Update your branch with the latest upstream changes:
git fetch upstream git rebase upstream/main
-
Run all tests and ensure they pass:
./gradlew allTests
-
Run code formatting:
./gradlew ktlintFormat
-
Update documentation if needed:
- Update README.md for new features
- Add/update KDoc comments
- Update CHANGELOG.md
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
-
Fill out the PR template with:
- Description of changes
- Related issue numbers
- Testing performed
- Screenshots (if UI changes)
-
Ensure CI checks pass
-
Request review from maintainers
- Maintainers will review your PR within 1-2 weeks
- Address feedback by pushing new commits
- Once approved, maintainers will merge your PR
- Your contribution will be included in the next release
- Check if the issue already exists
- Verify you're using the latest version
- Test on multiple platforms if possible
**Describe the bug**
A clear description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Create formatter with locale X
2. Format amount Y with currency Z
3. See error
**Expected behavior**
What you expected to happen.
**Actual behavior**
What actually happened.
**Environment:**
- Kurrency version: 0.2.3
- Platform: Android/iOS/JVM/JS/WasmJs
- OS version: Android 14, iOS 17, etc.
- Kotlin version: 2.3.0
**Code sample:**
```kotlin
val formatter = CurrencyFormatter(KurrencyLocale.US)
val result = formatter.formatCurrencyStyleResult("1234.56", "USD")
## Suggesting Features
### Feature Request Template
```markdown
**Is your feature request related to a problem?**
A clear description of the problem. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear description of what you want to happen.
**Describe alternatives you've considered**
Other solutions or features you've considered.
**Additional context**
Any other context, mockups, or examples.
- Open a GitHub Discussion
- Open an issue with the
questionlabel
By contributing to Kurrency, you agree that your contributions will be licensed under the Apache License 2.0.
Thank you for contributing to Kurrency! 🎉