Skip to content

Commit e9c74bd

Browse files
haasonsaasclaude
andcommitted
feat: add PR summaries, interactive commands, changelog generation, and path-based config
- Add comprehensive PR summary generation with statistics and risk analysis - Implement interactive @diffscope commands for PR comments - Create changelog/release notes generator with conventional commit support - Add path-based configuration for customizing review behavior - Support for focus areas, severity overrides, and custom prompts per path - Generate changelogs grouped by change type with emoji support - Full documentation and examples for all new features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2684cf1 commit e9c74bd

11 files changed

Lines changed: 1466 additions & 20 deletions

File tree

.diffscope.yml.example

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# DiffScope Configuration Example
2+
# Rename this file to .diffscope.yml to use
3+
4+
# Model configuration
5+
model: gpt-4o
6+
temperature: 0.2
7+
max_tokens: 4000
8+
9+
# API configuration (optional - can use environment variables)
10+
# api_key: your-api-key-here
11+
# base_url: https://api.openai.com/v1
12+
13+
# Global exclude patterns
14+
exclude_patterns:
15+
- "**/*.generated.*"
16+
- "**/node_modules/**"
17+
- "**/target/**"
18+
- "**/.git/**"
19+
- "**/dist/**"
20+
- "**/build/**"
21+
22+
# Path-specific configurations
23+
paths:
24+
# API endpoints need extra security focus
25+
"src/api/**":
26+
focus:
27+
- security
28+
- validation
29+
- authentication
30+
severity_overrides:
31+
security: error # Elevate all security issues to errors
32+
system_prompt: |
33+
Pay special attention to:
34+
- SQL injection vulnerabilities
35+
- Authentication bypass risks
36+
- Input validation gaps
37+
- Rate limiting implementation
38+
39+
# Test files have different requirements
40+
"tests/**":
41+
focus:
42+
- coverage
43+
- assertions
44+
- test_quality
45+
severity_overrides:
46+
style: suggestion # Downgrade style issues in tests
47+
ignore_patterns:
48+
- "*.snapshot"
49+
- "*.fixture"
50+
51+
# Frontend components
52+
"src/components/**":
53+
focus:
54+
- accessibility
55+
- performance
56+
- react_best_practices
57+
extra_context:
58+
- "src/styles/theme.ts" # Always include theme context
59+
60+
# Database migrations are critical
61+
"migrations/**":
62+
focus:
63+
- data_integrity
64+
- rollback_safety
65+
- performance
66+
severity_overrides:
67+
bug: error # All bugs in migrations are critical
68+
system_prompt: |
69+
Database migrations are critical. Check for:
70+
- Data loss risks
71+
- Rollback capability
72+
- Index performance impact
73+
- Lock duration concerns
74+
75+
# Documentation files
76+
"docs/**":
77+
focus:
78+
- clarity
79+
- completeness
80+
- examples
81+
severity_overrides:
82+
bug: info # Bugs in docs are less critical
83+
84+
# Plugin configuration
85+
plugins:
86+
eslint: true
87+
semgrep: true
88+
duplicate_filter: true

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "diffscope"
3-
version = "0.4.4"
3+
version = "0.5.0"
44
edition = "2021"
55
authors = ["Jonathan Haas <jonathan@haas.holdings>"]
66
description = "A composable code review engine with smart analysis, confidence scoring, and professional reporting"
@@ -26,6 +26,8 @@ git2 = "0.18"
2626
once_cell = "1.19"
2727
regex = "1.10"
2828
dirs = "5.0"
29+
chrono = "0.4"
30+
glob = "0.3"
2931

3032
[dev-dependencies]
3133
tempfile = "3.8"

README.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ A composable code review engine for automated diff analysis.
66

77
- **Model Agnostic**: Works with OpenAI, Anthropic Claude 4, Ollama, and any OpenAI-compatible API
88
- **Git Integration**: Review uncommitted, staged, or branch changes directly
9-
- **PR Reviews**: Analyze and comment on GitHub pull requests
9+
- **PR Reviews**: Analyze and comment on GitHub pull requests with interactive commands
1010
- **Smart Prompting**: Advanced prompt engineering with examples, XML structure, and chain-of-thought
1111
- **Commit Messages**: AI-powered commit message suggestions following conventional commits
1212
- **Composable Architecture**: Modular components that work together
1313
- **Plugin System**: Extensible pre-analyzers and post-processors
1414
- **Multiple Outputs**: JSON, patch, or markdown formats
1515
- **CI/CD Ready**: GitHub Action, GitLab CI, and Docker support
1616
- **Smart Review**: Enhanced analysis with confidence scoring, fix effort estimation, and executive summaries
17+
- **Path-Based Configuration**: Customize review behavior for different parts of your codebase
18+
- **Changelog Generation**: Generate changelogs and release notes from git history
19+
- **Interactive Commands**: Respond to PR comments with @diffscope commands
1720

1821
## Quick Start
1922

@@ -430,6 +433,104 @@ stage('AI Code Review') {
430433
5. **Output Parsing**: Handle both empty reviews and JSON parsing errors gracefully
431434
6. **Conditional Runs**: Skip reviews on draft PRs or specific file types
432435

436+
## New Features in v0.5.0
437+
438+
### 🔄 Changelog Generation
439+
440+
Generate professional changelogs and release notes from your git history:
441+
442+
```bash
443+
# Generate changelog from a specific tag to HEAD
444+
diffscope changelog --from v0.4.0 --to HEAD
445+
446+
# Generate release notes for a new version
447+
diffscope changelog --release v0.5.0 --from v0.4.0
448+
449+
# Output to file
450+
diffscope changelog --from v0.4.0 --output CHANGELOG.md
451+
```
452+
453+
The changelog generator:
454+
- Parses conventional commits automatically
455+
- Groups changes by type (features, fixes, etc.)
456+
- Highlights breaking changes
457+
- Shows contributor statistics
458+
- Generates both changelogs and release notes formats
459+
460+
### 🎯 Path-Based Configuration
461+
462+
Customize review behavior for different parts of your codebase:
463+
464+
**.diffscope.yml**
465+
```yaml
466+
# Global configuration
467+
model: gpt-4o
468+
temperature: 0.2
469+
max_tokens: 4000
470+
471+
# Exclude patterns
472+
exclude_patterns:
473+
- "**/*.generated.*"
474+
- "**/node_modules/**"
475+
476+
# Path-specific rules
477+
paths:
478+
# API endpoints need security focus
479+
"src/api/**":
480+
focus:
481+
- security
482+
- validation
483+
- authentication
484+
severity_overrides:
485+
security: error # All security issues become errors
486+
system_prompt: |
487+
Focus on SQL injection, auth bypass, and input validation
488+
489+
# Test files have different standards
490+
"tests/**":
491+
focus:
492+
- coverage
493+
- assertions
494+
severity_overrides:
495+
style: suggestion # Style issues are just suggestions
496+
497+
# Database migrations are critical
498+
"migrations/**":
499+
severity_overrides:
500+
bug: error # Any bug in migrations is critical
501+
```
502+
503+
### 💬 Interactive PR Commands
504+
505+
Respond to pull request comments with interactive commands:
506+
507+
```
508+
@diffscope review # Re-review the changes
509+
@diffscope review security # Focus review on security
510+
@diffscope ignore src/generated/ # Ignore specific paths
511+
@diffscope explain line 42 # Explain specific code
512+
@diffscope generate tests # Generate unit tests
513+
@diffscope help # Show all commands
514+
```
515+
516+
### 📊 PR Summary Generation
517+
518+
Generate executive summaries for pull requests:
519+
520+
```bash
521+
# Generate PR summary with statistics
522+
diffscope pr --summary
523+
524+
# Generate and post to GitHub
525+
diffscope pr --number 123 --summary --post-comments
526+
```
527+
528+
The summary includes:
529+
- Change statistics and impact analysis
530+
- Key modifications by category
531+
- Risk assessment
532+
- Review recommendations
533+
433534
## Contributing
434535

435536
Contributions are welcome! Please open an issue first to discuss what you would like to change.

RELEASE_NOTES.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Release Notes - v0.5.0
2+
3+
📅 **Release Date**: 2025-06-06
4+
5+
## 📊 Summary
6+
7+
This release brings major new features inspired by CodeRabbit, including PR summary generation, interactive commands, changelog generation, and path-based configuration.
8+
9+
- 🎯 **Total Changes**: 4 major features
10+
-**New Features**: 4
11+
- 🐛 **Bug Fixes**: 0
12+
- ⚠️ **Breaking Changes**: 0
13+
14+
## ✨ Highlights
15+
16+
### 1. PR Summary Generation
17+
- Generate comprehensive executive summaries for pull requests
18+
- Includes statistics, change analysis, and risk assessment
19+
- Seamless GitHub integration with `diffscope pr --summary`
20+
21+
### 2. Interactive PR Commands
22+
- Respond to PR comments with `@diffscope` commands
23+
- Support for review, ignore, explain, generate, and help commands
24+
- Makes code review more collaborative and interactive
25+
26+
### 3. Changelog & Release Notes Generation
27+
- Automatically parse conventional commits
28+
- Generate professional changelogs with `diffscope changelog`
29+
- Support for both changelog and release notes formats
30+
- Group changes by type with emoji support
31+
32+
### 4. Path-Based Configuration
33+
- Configure review behavior per directory/file pattern
34+
- Set custom focus areas, severity overrides, and prompts
35+
- Support for exclude patterns and path-specific rules
36+
- Example: Elevate all security issues to errors in API endpoints
37+
38+
## 🔧 Configuration
39+
40+
Create a `.diffscope.yml` file to customize behavior:
41+
42+
```yaml
43+
# Path-specific rules
44+
paths:
45+
"src/api/**":
46+
focus: [security, validation]
47+
severity_overrides:
48+
security: error
49+
```
50+
51+
## 🚀 Getting Started
52+
53+
```bash
54+
# Install the latest version
55+
cargo install diffscope
56+
57+
# Generate a changelog
58+
diffscope changelog --from v0.4.0
59+
60+
# Use path-based configuration
61+
cp .diffscope.yml.example .diffscope.yml
62+
```
63+
64+
## 👥 Contributors
65+
66+
- Jonathan Haas (@Haasonsaas)
67+
68+
## 📝 Full Changelog
69+
70+
For detailed changes, see the [full changelog](https://github.com/Haasonsaas/diffscope/compare/v0.4.4...v0.5.0).

0 commit comments

Comments
 (0)