Thank you for your interest in contributing to SingleFlight! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Development Environment Setup
- Coding Standards
- Testing
- Pull Request Process
- Issue Reporting
By participating in this project, you are expected to uphold our Code of Conduct:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- Java Development Kit (JDK) 17 or higher
- Maven 3.6 or higher
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/singleflight.git cd singleflight - Add the original repository as an upstream remote:
git remote add upstream https://github.com/Wenrh2004/singleflight.git
- Build the project using Maven:
mvn clean install
Please follow these coding standards when contributing to SingleFlight:
- Use 4 spaces for indentation (not tabs)
- Follow Java naming conventions:
CamelCasefor class namescamelCasefor method and variable namesUPPER_SNAKE_CASEfor constants
- Maximum line length of 120 characters
- Always add appropriate Javadoc comments for public methods and classes
- Use meaningful variable and method names
- Update documentation when changing functionality
- Write clear and concise commit messages
- Include examples for new features
All contributions should include appropriate tests:
- Write unit tests for new functionality
- Ensure all tests pass before submitting a pull request
- Aim for high test coverage of your code
- Run tests using Maven:
mvn test
- Update your fork to the latest upstream version
- Create a new branch for your feature or bugfix:
or
git checkout -b feature/your-feature-name
git checkout -b fix/issue-you-are-fixing
- Make your changes and commit them with clear, descriptive messages
- Merge the latest changes from the upstream repository:
git fetch upstream git merge upstream/main
- Commit your changes:
where
git commit -m "<type>(<scope>): <subject>"<type>can befeat,fix,docs,style,refactor,test, orchore, and<scope>is optional. - Push your branch to your fork:
git push origin feature/your-feature-name
- Open a pull request against the main repository
- Ensure the PR description clearly describes the problem and solution
- Reference any relevant issues in your PR description
Before your pull request can be merged, it will be reviewed for:
- Code quality and style
- Test coverage
- Documentation
- Compatibility with existing code
When reporting issues, please include:
- A clear and descriptive title
- A detailed description of the issue
- Steps to reproduce the problem
- Expected behavior
- Actual behavior
- Environment information (JDK version, OS, etc.)
- Any relevant logs or screenshots
Thank you for contributing to SingleFlight! Your efforts help make this project better for everyone.