Thank you for your interest in contributing to the Clean Architecture Generator! This project is open for contributions in the form of Pull Requests (PRs). This document provides guidelines and information to help you get started.
- Getting Started
- Development Setup
- Project Structure
- Code Style and Standards
- Testing
- Submitting Changes
- Code Review Process
- Reporting Issues
- Questions and Discussion
Before contributing, please ensure you have:
- Forked the repository to your GitHub account
- Cloned your fork to your local machine
- Set up the development environment (see Development Setup)
- Created a feature branch for your changes
- Java 21 or later
- Gradle 8.0 or later
- IntelliJ IDEA or Android Studio (for plugin development)
- Git
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/Clean-Architecture-Generator.git cd Clean-Architecture-Generator -
Add the upstream remote:
git remote add upstream https://github.com/EranBoudjnah/Clean-Architecture-Generator.git
-
Build the project:
./gradlew build
The project consists of three main modules:
cli/- Command-line interface for generating Clean Architecture codecore/- Core business logic and code generation templatesplugin/- IntelliJ Platform plugin for Android Studio integration
├── cli/ # Command-line interface
├── core/ # Core business logic and templates
├── plugin/ # IntelliJ Platform plugin
├── automation/ # Build and development automation
├── gradle/ # Gradle configuration
├── build.gradle.kts # Root build configuration
└── .github/README.md # Project documentation
- Function and class size matters - Keep functions and classes focused and concise
- No abbreviations or acronyms - Use full words (e.g., "directory" not "dir", "arguments" not "args")
- No comments except in tests - Code should be self-documenting
- Test comments should mark sections - Use "Given", "When", "Then" comments in tests
The project uses several tools to maintain code quality:
- ktlint - Kotlin code style enforcement
- Pre-commit hooks - Automatic code quality checks before commits
# Format code with ktlint
./gradlew ktlintFormat
# Check code style
./gradlew ktlintCheck
# Run all checks
./gradlew check- Write tests for new functionality - All new features must have corresponding tests
- Update existing tests - When changing behavior, update or add tests accordingly
- Test coverage - Aim for comprehensive test coverage of new code
# Run all tests
./gradlew test
# Run tests for a specific module
./gradlew :core:test
./gradlew :cli:test
./gradlew :plugin:testTests should follow the Given-When-Then pattern:
@Test
fun `Given valid input provided when generate then generates use case`() {
// Given
val useCaseName = "GetUserData"
val inputType = "UserId"
val outputType = "User"
val expectedName = "GetUserDataUseCase"
// When
val actual = useCaseGenerator.generate(useCaseName, inputType, outputType)
// Then
assertNotNull(actual)
assertThat(actual.name).isEqualTo(expectedName)
}-
Ensure all tests pass:
./gradlew test -
Run code quality checks:
./gradlew ktlintCheck
-
Update documentation if your changes affect:
- CLI usage or options
- Plugin functionality
-
Consider updating README if your changes add new features or change behavior
-
Push your changes to your fork:
git push origin your-feature-branch
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what was changed and why
- Reference to any related issues
- Screenshots for UI changes (if applicable)
-
PR Title Format:
Type: Brief description of change Examples: - Feature: Add support for custom use case templates - Fix: Resolve issue with data source generation - Refactor: Improve code generation performance - Docs: Update CLI help documentation
Follow conventional commit format:
Type(scope): description
Examples:
- feat(cli): added new --template option for custom generation
- fix(core): resolved issue with package name validation
- refactor(plugin): improved dialog validation logic
- test(core): added tests for use case generator
All PRs will be reviewed for:
- Code quality - Follows project coding standards
- Test coverage - Adequate tests for new functionality
- Documentation - Updated where necessary
- Performance - No performance regressions
- Security - No security vulnerabilities
- Backward compatibility - Changes don't break existing functionality
- Initial review - Usually within 2-3 business days
- Follow-up reviews - Usually within 1-2 business days after changes
- Final approval - After all feedback is addressed
- Respond to all comments - Acknowledge feedback and explain changes
- Make requested changes - Update code based on reviewer suggestions
- Request re-review - When ready for another review
- Resolve conversations - Mark resolved comments appropriately
When reporting bugs, please include:
- Clear description of the problem
- Steps to reproduce the issue
- Expected vs. actual behavior
- Environment details (OS, Java version, etc.)
- Screenshots or logs if applicable
For feature requests, please describe:
- Use case for the feature
- Expected behavior and interface
- Benefits to users
- Implementation suggestions (if any)
- GitHub Issues - For bugs, feature requests, and questions
- GitHub Discussions - For general questions and community discussion
- Pull Request comments - For specific implementation questions
- Be respectful and constructive in all interactions
- Help others by reviewing their PRs and answering questions
- Follow the project's coding standards and conventions
- Ask questions if you're unsure about anything
- Project README - Overview and usage instructions
- Build configuration -
build.gradle.ktsfiles for module details - Existing code - Study existing implementations for patterns and style
- Test files - Examples of testing approaches and conventions
Thank you for contributing to the Clean Architecture Generator! Your contributions help make this tool more powerful and useful for developers around the world.
This document is a living guide. If you notice any issues or have suggestions for improvement, please submit a PR to update it.