We welcome contributions! This document provides guidelines for contributing to the project.
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Respect differing viewpoints and experiences
- Check existing issues to avoid duplicates
- Use issue templates when available
- Provide clear description and steps to reproduce
- Include version information and environment details
- Check if the enhancement has been suggested
- Open a discussion first for major changes
- Explain the use case and benefits
- Consider backward compatibility
-
Fork the repository
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Sign your commits (Required)
All commits must be signed off according to the Developer Certificate of Origin (DCO):
git commit -s -m "Your commit message"This adds
Signed-off-by: Your Name <your@email.com>to your commits. See our DCO documentation for detailed instructions. -
Follow coding standards
- Java 17+ features
- Clear, self-documenting code
- Javadoc for all public methods
- Consistent formatting
-
Write tests
- Unit tests for new functionality
- Integration tests for compatibility
- Maintain 100% test pass rate
-
Update documentation
- Update README if needed
- Add/update Javadoc
- Update relevant docs/ files
-
Commit with clear messages and DCO sign-off
git commit -s -m "Add feature: brief description Detailed explanation of what and why"
Note: The
-sflag automatically adds the required DCO sign-off. -
Push and create PR
- Reference any related issues
- Describe changes clearly
- Note any breaking changes
- Java 17 or higher
- Gradle 8.5+
- Git
git clone https://github.com/lucimber/bcrypt-java.git
cd bcrypt-java/bcrypt
./gradlew build# All tests
./gradlew test
# Specific test class
./gradlew test --tests BCryptServiceTest
# Integration tests only
./gradlew test --tests "*IntegrationTest"- Use 4 spaces for indentation
- Maximum line length: 120 characters
- Braces on same line for classes and methods
- Meaningful variable and method names
- Avoid abbreviations
Example:
/**
* Verifies a password against a BCrypt hash.
*
* @param password the password to verify
* @param hash the hash to verify against
* @return true if the password matches
*/
public boolean verify(Password password, Hash hash) {
// Implementation
}- Test each public method
- Cover edge cases
- Test error conditions
- Use descriptive test names
@Test
@DisplayName("Should reject empty password")
void shouldRejectEmptyPassword() {
assertThrows(IllegalArgumentException.class,
() -> new Password(""));
}- Test compatibility with Spring Security
- Test compatibility with Bouncy Castle
- Verify known test vectors
- Test cross-compatibility
All public classes and methods must have Javadoc:
/**
* Brief description.
*
* Detailed explanation if needed.
*
* @param paramName description
* @return description
* @throws ExceptionType when this occurs
*/- Use clear, concise language
- Include code examples
- Keep files focused on single topics
- Update when API changes
- Ensure all tests pass
- Update version in build.gradle.kts
- Update CHANGELOG.md
- Create release tag
- Build and publish artifacts
- Open a GitHub Discussion
- Check existing documentation
- Review closed issues and PRs
Contributors will be recognized in:
- GitHub contributors page
- Release notes for significant contributions
- CONTRIBUTORS.md file (for major contributors)
Thank you for contributing to BCrypt Java Library!