First off, thank you for considering contributing to IBAN Commons! 🎉
We welcome contributions from everyone, whether you're fixing a typo, reporting a bug, or implementing a new feature.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/iban-commons.git - Create a branch:
git checkout -b feature/your-feature-name - Make your changes and commit them
- Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request and describe your changes
Found a bug? Please open an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs. actual behavior
- Your Java version and OS
- Sample code if possible
Have an idea? We'd love to hear it! Please:
- Check existing discussions first
- Open a new discussion or issue
- Explain your use case and why this enhancement would be useful
We appreciate all contributions! Here's what we look for:
- Follow existing style: Use the same code style as the rest of the project (import order, 4 spaces-indenting, bracket placements)
- Write tests: All new features and bug fixes must have tests
- Keep it simple: Prefer clarity over cleverness
- Document: Add JavaDoc for public APIs
# Run all tests
mvn clean verify
# Run specific test
mvn test -Dtest=IbanTestWrite clear, concise commit messages.
Refer to the issue if issue-related.
Add support for new country XY
- Implement IBAN structure for country XY
- Add test cases for XY IBANs
- Update IbanRegistry with official data
- JDK 17 or higher required to build the project
- Maven 3.9+
- Git
- Spare Time
git clone https://github.com/SpeedBankingDe/iban-commons.git
cd iban-commons
mvn clean install
# Running all tests
mvn testWe use several tools to maintain code quality:
- Checkstyle: Code style enforcement
- PMD: Static code analysis
- PITest: Mutation testing
- Maven Enforcer Plugin: Control certain environmental constraints
Run all checks:
mvn clean verify- Zero dependencies: Do not add external dependencies without discussion
- Java 8 compatible: Code must work with Java 8
- Immutability: Prefer immutable objects
- Thread-safety: Ensure thread-safe code
- Performance: Consider performance impact
- Classes:
PascalCase(e.g.,IbanValidator) - Methods:
camelCase(e.g.,validateChecksum()) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_IBAN_LENGTH) - Packages: lowercase (e.g.,
de.speedbanking.iban)
- JavaDoc: Required for all public APIs
- Inline comments: Use sparingly, prefer self-documenting code
- README: Update if adding user-facing features
- Aim for 100% coverage
- Test both happy paths and edge cases
- Include tests for invalid input
Use descriptive names that explain what's being tested:
@Test
void shouldThrowExceptionWhenIbanIsTooShort() {
assertThrows(InvalidIbanException.class,
() -> Iban.of("DE123"));
}
@Test
void shouldReturnEmptyOptionalForInvalidIban() {
Optional<Iban> result = Iban.tryParse("INVALID");
assertThat(result).isEmpty();
}We use AssertJ for fluent assertions:
assertThat(iban.getCountryCode()).isEqualTo("DE");
assertThat(iban.getBankCode()).isNotNull();
assertThat(validIbans).hasSize(5).allMatch(Iban::isValid);- Update documentation if needed (README, JavaDoc)
- Add/update tests for your changes
- Run all tests:
mvn clean verify - Check that builds pass on GitHub Actions
- Request review from maintainers
- Address feedback promptly and kindly
- Code follows project style
- Tests added/updated
- All tests pass
- Documentation updated
- No breaking changes (or discussed first)
- Commit messages are clear
To add support for a new IBAN country:
- Get official data from SWIFT IBAN Registry
- Add enum constant in
IbanRegistry.java - Add tests in
IbanRegistryTest.javaandIbanTest.java - Update documentation if needed
- Run benchmarks to ensure no performance regression
- Be respectful: We're all here to help
- Be patient: Maintainers are volunteers
- Be constructive: Focus on solutions, not problems
- Ask questions: If something's unclear, just ask!
For questions or discussions:
This project follows a simple code of conduct:
- Be kind and respectful
- Welcome newcomers
- Focus on constructive feedback
- Respect different viewpoints and experiences
All contributors will be recognized in:
- GitHub contributors list
- Release notes (for significant contributions)
Thank you for helping make IBAN Commons better! 🚀
Questions? Don't hesitate to ask in Discussions!