A Spring Boot application that provides automated code review capabilities for GitHub pull requests using Large Language Models (LLMs) and traditional static analysis.
This project aims to create a simple-to-use Spring Boot application that enables developers to run intelligent code reviews on GitHub repositories. By combining LLM-powered analysis with traditional code quality rules, the system provides comprehensive feedback on code changes in pull requests.
- GitHub Integration: Seamless integration with GitHub PRs and comments
- LLM-Powered Analysis: Intelligent code review using advanced language models
- Traditional Rules: Static analysis rules for code quality and best practices
- Modular Architecture: Clean separation of concerns with dedicated modules
- REST API: Simple API for triggering reviews and managing configurations
- Extensible: Easy to add new rules and analysis capabilities
The project follows a modular Maven structure with dependencies flowing from data models to parsing, analysis, integration, and the main app.
| Module | Description |
|---|---|
| finding-schema | Core data models for code findings |
| llm-finding-schema | LLM-specific extensions to schemas |
| java-parser | Java AST parsing using JavaParser |
| diff-mapper-core | Unified diff parsing and AST intersection |
| github-connector | GitHub API integration for PRs |
| rule-engine | Framework for analysis rules |
| outputs | Finding formatting and rendering |
| bootstrap-app | Main Spring Boot application |
Additional folders:
- metadata/ # Development tracking and summaries
- delete_me/ # Original specification documents
- Java 21 - Modern Java runtime
- Spring Boot 3.x - Application framework
- JavaParser - Java source code parsing
- LangChain4j - LLM integration
- GitHub API - Repository integration
- Maven - Build and dependency management
This project uses Google Java Style conventions for consistent, professional code formatting across the entire codebase.
- Checkstyle Plugin: Enforces coding standards during Maven builds with error-level severity
- Spotless Plugin: Automated code formatting using Google Java Format for consistent style
- VS Code Integration: Format-on-save configured for Google style conventions
- Automated Formatting:
mvn spotless:applyformats the entire codebase to Google style - Build Enforcement: Checkstyle runs during
mvn compileand fails on style violations - IDE Integration: VS Code automatically formats code on save using Google conventions
- Convenient Tooling: Well-supported Google style works seamlessly across Maven, VS Code, and CI/CD
# Format entire codebase
mvn spotless:apply
# Check for style violations (runs automatically during compile)
mvn checkstyle:check
# Clean build (includes style checking)
mvn clean compile- Consistency: Uniform code style across all developers and environments
- Automation: No manual formatting decisions - tools handle everything
- Quality: Catches common style issues before they reach production
- Productivity: Developers focus on logic, not formatting debates
- Automated PR Reviews: Automatically review pull requests for code quality
- LLM-Powered Feedback: Get intelligent suggestions from language models
- Custom Rules: Define organization-specific coding standards
- CI/CD Integration: Integrate with existing development workflows
- Team Collaboration: Provide consistent review feedback across teams
-
Clone the repository
git clone <repository-url> cd code-reviewer
-
Configure GitHub credentials
# application.yml github: token: your-github-token webhook-secret: your-webhook-secret
-
Run the application
mvn spring-boot:run
-
Trigger a review
curl -X POST http://localhost:8080/api/review/pr \ -H "Content-Type: application/json" \ -d '{"owner":"myorg","repo":"myrepo","prNumber":123}'
- API Documentation - REST API endpoints
- Module Guides - Individual module documentation
- Development - Development tracking and summaries
Configuration Background: The project uses Google Java Format style in the Spotless Maven plugin for automated formatting. While the Eclipse formatter would have been the path of least resistance (requiring only Checkstyle configuration adjustments), we committed to Google Java Format from the start. Since Google doesn't provide an official VS Code plugin, we use a third-party extension that mimics the Google Java Format style.
-
Install the Google Java Format Extension:
- Install the VS Code extension from Marko Milic: Java Google Format
- Note: There is no official Google plugin for VS Code, so we use Marko Milic's extension
-
Configure VS Code Settings:
- Open Command Palette (
Ctrl+Shift+P) - Select "Dev Containers: Settings" and set format to JSON
- Add the following configuration to your
.vscode/settings.json:
{ "editor.formatOnSave": true, "[java]": { "editor.defaultFormatter": "mmilic.java-google-format" } } - Open Command Palette (
-
Resolve Formatter Conflicts:
- The first time you use "Format Document" (
Shift+Alt+F), VS Code will prompt you to choose between formatters - Select the Google Java Format option (Marko Milic's extension)
- This setting is configured globally
- The first time you use "Format Document" (
Note: We may consider switching back to the native Eclipse formatter in the future as it presents fewer configuration obstacles. The current Google formatter setup is chosen for its compatibility with the Spotless plugin used in our Maven build process.
For complete Google Java Style guidelines, see: Google Java Style Guide
The project uses Spotless with the Eclipse WTP XML formatter (Red Hat's XML plugin) for consistent XML formatting across the entire codebase.
- Spotless Plugin: Configured in
pom.xmlto format all*.xmlfiles using Eclipse WTP XML formatter version 4.33 - Automatic Formatting: XML files are automatically formatted when saved through the configured formatter
- Comprehensive Coverage: Formats all XML files in the project, including configuration files like
pom.xml,checkstyle.xml, etc.
# Format all XML files in the project
mvn spotless:apply
# Format specific XML files
mvn spotless:apply -DspotlessFiles="pom.xml,checkstyle.xml"This project is licensed under the MIT License - see the LICENSE file for details.