Skip to content

Commit c4c0409

Browse files
randleeclaude
andauthored
feat: Sprint 5 - CLI Polish & Class Diff (#2)
* feat: Complete Sprint 5 - CLI Polish & Class Diff Sprint 5A: Class Matcher - ClassMatcher with multiple matching strategies - ExactName, Interface, Similarity, and Auto strategies - Support for partial classes, nested classes, generics - ClassMatchOptions and ClassMatchResult models - 39 comprehensive unit tests Sprint 5B: Class Command - New `class` subcommand for class-to-class comparison - ClassSpecParser for "file.cs:ClassName" syntax - --match-by, --interface, --similarity options - Integration with output formatters - 23 unit tests Sprint 5C: CLI Options - --ignore-whitespace (-w) option - --ignore-comments (-c) option - --context (-C) option for context lines - --mode (-m) option (auto/roslyn/line) - --output (-o) and --out-file options - --rich (-r) option for Spectre.Console output - Comprehensive help text with examples - 57 unit tests Test Results: 361 tests passing - Core: 147 tests (+39) - Output: 130 tests - CLI: 84 tests (+80) Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Complete Sprint 6 - Testing & Documentation Sprint 6A: Edge Case Tests - SyntaxErrorTests for parse error handling - EncodingTests for UTF-8/UTF-16 and Unicode - WhitespaceTests for whitespace-only changes - ModernCSharpTests (records, primary constructors, raw strings, etc.) - PreprocessorTests for #if/#endif directives - GenericTests for generic classes/methods - 160 new edge case tests Sprint 6B: Integration Tests - New RoslynDiff.Integration.Tests project - End-to-end C#, VB.NET, and line diff tests - ClassCommand integration tests - Output format integration tests - Error handling tests - 115 integration tests Sprint 6C: Documentation - Complete README.md with installation and usage - docs/usage.md - Detailed CLI documentation - docs/output-formats.md - Format descriptions - docs/api.md - Programmatic API reference - docs/architecture.md - System design overview - docs/performance.md - Performance characteristics - CHANGELOG.md - Version history - samples/ - Example files and outputs Sprint 6D: Performance Tests - RoslynDiff.Benchmarks project with BenchmarkDotNet - CSharpDifferBenchmarks for diff performance - SyntaxComparerBenchmarks for comparison speed - OutputFormatterBenchmarks for formatting - PerformanceTests.cs for timeout validation Test Results: 650 tests passing - Core: 321 tests (+160) - Output: 130 tests - CLI: 84 tests - Integration: 115 tests (new) Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Rand Lee <[email protected]> Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent b0d9a48 commit c4c0409

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+15335
-36
lines changed

CHANGELOG.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Planned
11+
- MCP Server integration for AI tooling
12+
- Folder/project comparison
13+
- Git integration (compare commits, branches)
14+
- F# support via FSharp.Compiler.Service
15+
16+
## [1.0.0] - 2025-XX-XX
17+
18+
### Added
19+
20+
#### Core Features
21+
- **C# Semantic Diff** - Full semantic analysis of C# source files using Roslyn
22+
- **VB.NET Semantic Diff** - Full semantic analysis of Visual Basic source files
23+
- **Line-by-Line Diff** - Fallback diff for non-.NET files using DiffPlex
24+
- **Rename Detection** - Detects when symbols are renamed (not just added/removed)
25+
- **Move Detection** - Identifies code that has been moved within a file
26+
27+
#### Change Detection
28+
- Class/struct/record/interface changes
29+
- Method/function changes
30+
- Property changes
31+
- Field changes
32+
- Namespace changes
33+
- Statement-level changes (in Roslyn mode)
34+
35+
#### CLI Commands
36+
- `diff` - Compare two files
37+
- `--mode` option: `auto`, `roslyn`, `line`
38+
- `--ignore-whitespace` / `-w` - Ignore whitespace differences
39+
- `--ignore-comments` / `-c` - Ignore comment differences
40+
- `--context` / `-C` - Control context lines
41+
- `--output` / `-o` - Select output format
42+
- `--out-file` - Write to file
43+
- `--rich` / `-r` - Rich terminal output
44+
45+
- `class` - Compare specific classes between files
46+
- `--match-by` / `-m` - Match strategy: `exact`, `interface`, `similarity`, `auto`
47+
- `--interface` / `-i` - Interface name for interface matching
48+
- `--similarity` / `-s` - Similarity threshold
49+
- `--output` / `-o` - Select output format
50+
- `--out-file` / `-f` - Write to file
51+
52+
#### Output Formats
53+
- **JSON** - Machine-readable format for AI/tooling
54+
- **HTML** - Interactive report with syntax highlighting
55+
- **Text** - Unified diff format (similar to git diff)
56+
- **Plain** - Simple text without ANSI codes
57+
- **Terminal** - Rich console output with Spectre.Console
58+
59+
#### Class Matching Strategies
60+
- Exact name matching
61+
- Interface implementation matching
62+
- Content similarity matching (for renamed classes)
63+
- Auto mode (exact first, then similarity)
64+
65+
#### API
66+
- `DifferFactory` for creating appropriate differs
67+
- `IDiffer` interface for custom differ implementations
68+
- `OutputFormatterFactory` for creating formatters
69+
- `IOutputFormatter` interface for custom formatters
70+
- `ClassMatcher` for flexible class matching
71+
72+
### Dependencies
73+
- .NET 10.0
74+
- Microsoft.CodeAnalysis.CSharp 4.12.0
75+
- Microsoft.CodeAnalysis.VisualBasic 4.12.0
76+
- DiffPlex 1.7.2
77+
- Spectre.Console 0.49.x
78+
- System.CommandLine 2.0.0-beta4
79+
80+
---
81+
82+
## Version History
83+
84+
### Versioning Strategy
85+
86+
This project follows [Semantic Versioning](https://semver.org/):
87+
88+
- **MAJOR** version for incompatible API changes
89+
- **MINOR** version for backward-compatible functionality additions
90+
- **PATCH** version for backward-compatible bug fixes
91+
92+
### Release Phases
93+
94+
| Phase | Version | Features |
95+
|-------|---------|----------|
96+
| Phase 1 | v1.0.0 | Core CLI (current) |
97+
| Phase 2 | v1.x | MCP Server integration |
98+
| Phase 3 | v2.0 | Folder/project/git support |
99+
| Phase 4 | v3.0 | Solution-level comparison |
100+
101+
---
102+
103+
## Migration Guide
104+
105+
### From 0.x to 1.0
106+
107+
If upgrading from pre-release versions:
108+
109+
1. **CLI Changes**
110+
- `--format` renamed to `--output` / `-o`
111+
- Default output format is now `text` (was `terminal`)
112+
- Use `--rich` / `-r` for colored terminal output
113+
114+
2. **API Changes**
115+
- `DiffResult` is now a record type (immutable)
116+
- `Change.Location` split into `OldLocation` and `NewLocation`
117+
- `OutputFormatter` interface renamed to `IOutputFormatter`
118+
119+
3. **JSON Output Schema**
120+
- Schema version updated to `roslyn-diff-output-v1`
121+
- `summary` object structure changed
122+
- Location objects now include `startColumn` and `endColumn`
123+
124+
---
125+
126+
## Links
127+
128+
- [GitHub Repository](https://github.com/randlee/roslyn-diff)
129+
- [Issue Tracker](https://github.com/randlee/roslyn-diff/issues)
130+
- [Documentation](./docs/)

0 commit comments

Comments
 (0)