Thank you for your interest in contributing to kosta-http-diff! This guide will help you set up your development environment and understand our contribution process.
- Getting Started
- Development Workflow
- Code Formatting and Style Guidelines
- Testing
- Code Review Process
- Go to the kosta-http-diff GitHub repository
- Click the "Fork" button in the top-right corner to create your own copy
git clone https://github.com/KonstantineVashalomidze/kosta-http-diff
cd kosta-http-diff
-
Ensure Java 21+ is installed:
java -version -
Install Maven for build management:
# Verify Maven installation mvn -version -
Build the project:
mvn clean install -
Set up your IDE:
- For IntelliJ IDEA:
- Open the project via File > Open
- Allow Maven to import the project dependencies
- Set the Project SDK to Java 21
- For Eclipse:
- Import the project as a Maven project
- Ensure JDK 21 compliance is configured
- For IntelliJ IDEA:
-
Run the application:
mvn exec:java -Dexec.mainClass="com.github.konstantinevashalomidze.KHttpDiff"
Use lowercase with the following prefixes:
feat/- for new featuresfix/- for bug fixesrefactor/- for code refactoringdocs/- for documentation updatestest/- for adding or updating testsperf/- for performance improvements
Examples:
feat/array-support
fix/parser-edge-case
docs/readme-update
refactor/lexer-optimization
# Ensure you're on the main branch
git checkout main
# Pull the latest changes
git pull origin main
# Create a new branch
git checkout -b feat/your-feature-name
Follow the Conventional Commits style:
git commit -m "feat: add array literal support"
git commit -m "fix(parser): handle missing semicolons"
git commit -m "docs: update installation instructions"
Each commit message should:
- Be concise and descriptive
- Use present tense ("add feature" not "added feature")
- Reference issue numbers when applicable (
"fix: handle null pointer exception closes #123")
To keep your fork in sync with the main repository:
# Add the original repo as an upstream remote
git remote add upstream https://github.com/KonstantineVashalomidze/kosta-http-diff
# Fetch changes from upstream
git fetch upstream
# Merge changes into your local main branch
git checkout main
git merge upstream/main
# Push the updated main to your fork
git push origin main
-
Push your branch to your fork:
git push origin feat/your-feature-name -
Navigate to your fork on GitHub
-
Click "Compare & pull request"
-
Ensure your PR description includes:
- Purpose of the changes
- Summary of implementation details
- Testing performed
- Screenshots/examples (if applicable)
- Related issues (using GitHub keywords like "Fixes #123")
-
Add a note confirming merge/rebase completion:
This PR has been rebased on latest main (SHA: abc123)
-
Naming Conventions:
- Class names:
PascalCase(e.g.,TokenParser) - Methods/variables:
camelCase(e.g.,parseExpression) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_TOKEN_LENGTH) - Package names: all lowercase (e.g.,
com.github.konstantinevashalomidze)
- Class names:
-
Code Organization:
- One class per file
- Related classes in the same package
- Annotate overrides with
@Override - Use
finalfor immutable variables and parameters - Prefer composition over inheritance
Classes should be organized in the following order:
public class Example {
// Constants
public static final int MAX_SIZE = 100;
// Static fields
private static Logger logger = LoggerFactory.getLogger(Example.class);
// Instance fields
private int counter = 0;
private String name;
// Constructors (ascending order by parameter count)
public Example() {
this("default");
}
public Example(String name) {
this.name = name;
}
// Public methods
public void process() {
// Implementation
}
// Private methods
private void helperMethod() {
// Implementation
}
// Getters and setters (at the bottom)
public int getCounter() {
return counter;
}
public void setCounter(int counter) {
this.counter = counter;
}
}- All public classes and methods should have JavaDoc comments
- Document non-obvious implementation decisions with inline comments
- Use
//for single-line comments - Format multi-line comments with appropriate indentation:
/** * This is a multi-line comment. * It describes complex logic. */
Run the full test suite:
mvn test
Run specific tests:
mvn test -Dtest=LexerTest
- Test files should match source file structure and naming
- Use JUnit Jupiter 5.9.2 for testing
- Mockito 5.3.1 is available for mocking
- Test cases should be independent and repeatable
- Name test methods descriptively:
shouldReturnNullWhenInputIsEmpty() - Include tests for edge cases and error conditions
-
Submit PR → Automated tests run → Maintainer review → Address feedback → Approval → Merge
-
PRs must meet these criteria before review:
- Pass all automated tests
- Follow code style guidelines
- Include appropriate tests
- Have a clear PR description
- Address all review comments before requesting re-review
- Use fixup commits during the review process