Thank you for your interest in contributing to LatteSplash! This document provides guidelines and steps for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Pull Request Process
- Coding Standards
- Reporting Bugs
- Requesting Features
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainer.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/lattesplash-java.git cd lattesplash-java - Add the upstream remote:
git remote add upstream https://github.com/Sandeepv68/lattesplash-java.git
- Create a feature branch:
git checkout -b feature/your-feature-name
- Java 11 or higher (JDK)
- Maven 3.6 or higher
- Git
# Compile the project
mvn compile
# Run all tests
mvn test
# Build the JAR package
mvn package
# Generate Javadoc
mvn javadoc:javadoc- IntelliJ IDEA: Import as Maven project
- Eclipse: Import Existing Maven Projects
- VS Code: Install Java Extension Pack
-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following the coding standards below
-
Write or update tests for your changes
-
Run the full test suite to ensure nothing is broken:
mvn test -
Commit your changes with a clear, descriptive message:
git commit -m "feat: add new feature description" -
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=LatteSplashTest
# Run specific test method
mvn test -Dtest=LatteSplashTest#testGetPhoto- All new features must include tests
- Tests should be in
src/test/java/com/lattesplash/ - Use JUnit 5 annotations:
@Test,@BeforeEach,@AfterEach - Follow the existing test patterns in the codebase
package com.lattesplash;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.BeforeEach;
import static org.junit.jupiter.api.Assertions.*;
class YourFeatureTest {
@BeforeEach
void setUp() {
// Setup test fixtures
}
@Test
void testFeatureBehavior() {
// Arrange
// Act
// Assert
}
}- Update documentation if your change affects public API
- Add CHANGELOG entry describing your change
- Ensure CI passes - all tests must pass
- Request review from maintainers
- Address feedback promptly
Use conventional commit format:
feat: add new featurefix: resolve bug in Xdocs: update documentationtest: add tests for Yrefactor: improve Zchore: update dependencies
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] All tests pass locally
## Checklist
- [ ] Code follows project style
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No breaking changes (or documented)- Follow Oracle Java Code Conventions
- Use meaningful variable and method names
- Keep methods focused and concise
- Add Javadoc for public APIs
- Classes: PascalCase (
LatteSplash,QueryParams) - Methods: camelCase (
getPhoto,listCollections) - Constants: UPPER_SNAKE_CASE (
BASE_URL) - Packages: lowercase (
com.lattesplash.api)
// 1. Package statement
package com.lattesplash;
// 2. Imports (alphabetical order)
import java.util.List;
import java.util.concurrent.CompletableFuture;
// 3. Class declaration
public class Example {
// 4. Constants
private static final String CONSTANT = "value";
// 5. Fields
private final String fieldName;
// 6. Constructors
public Example(String value) {
this.fieldName = value;
}
// 7. Public methods
public String getFieldName() {
return fieldName;
}
// 8. Private methods
private void helperMethod() {
// implementation
}
}- Use checked exceptions (
LatteSplashError) for API errors - Provide meaningful error messages
- Don't swallow exceptions silently
// Good
try {
return httpClient.execute(request);
} catch (IOException e) {
throw new LatteSplashError("Failed to execute request: " + e.getMessage(), e);
}
// Bad
try {
return httpClient.execute(request);
} catch (IOException e) {
return null; // Don't do this
}**Describe the bug**
A clear description of the bug
**To Reproduce**
Steps to reproduce the behavior
**Expected behavior**
What you expected to happen
**Screenshots**
If applicable, add screenshots
**Environment**
- Java version:
- OS:
- Library version:
**Additional context**
Any other information- GitHub Issues: https://github.com/Sandeepv68/lattesplash-java/issues
**Is your feature request related to a problem?**
A clear description of the problem
**Describe the solution you'd like**
What you want to happen
**Describe alternatives you've considered**
Other solutions you've thought about
**Additional context**
Any other information, mockups, or examplesIf you have questions about contributing, feel free to open an issue with the label "question" or reach out to the maintainers.
By contributing to LatteSplash, you agree that your contributions will be licensed under the MIT License.