Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dotnet_diagnostic.SA1101.severity = none
# SA1413: Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = none

dotnet_diagnostic.SA1011.severity = none

# SA0001: XML comment analysis is disabled
dotnet_diagnostic.SA0001.severity = none

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ node_modules/
*.binlog

# Local History for Visual Studio
.localhistory/
.localhistory/test-report/
11 changes: 6 additions & 5 deletions .kiro/specs/dotnet-api-diff/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Each task should follow this git workflow:
- **Git Workflow**: Create branch `feature/task-4.3-change-classification`, commit, push, and create PR
- _Requirements: 3.1, 7.1, 7.2, 7.3, 7.4_

- [ ] 5. Create CLI interface and argument parsing
- [ ] 5.1 Implement command-line interface using System.CommandLine
- [x] 5. Create CLI interface and argument parsing
- [x] 5.1 Implement command-line interface using Spectre.Console.Cli
- Create CLI commands and options for assembly paths, configuration, output format
- Implement help text and usage examples
- Write integration tests for CLI argument parsing
Expand All @@ -108,11 +108,12 @@ Each task should follow this git workflow:
- _Requirements: 3.2, 3.3, 5.1, 5.2, 5.3, 5.4_

- [ ] 6. Implement output formatting and reporting
- [ ] 6.1 Create console output formatter
- Implement ConsoleFormatter with colored output for additions, removals, modifications
- [ ] 6.1 Create ReportGenerator and console output formatter
- Implement ReportGenerator interface with support for multiple formats
- Create ConsoleFormatter with colored output for additions, removals, modifications
- Add summary statistics and breaking change indicators
- Write unit tests for console output formatting
- **Git Workflow**: Create branch `feature/task-6.1-console-formatter`, commit, push, and create PR
- **Git Workflow**: Create branch `feature/task-6.1-report-generator`, commit, push, and create PR
- _Requirements: 4.4, 8.1, 8.4_

- [ ] 6.2 Implement JSON output formatter
Expand Down
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ task coverage
task coverage:view

# Run the application with arguments
task run -- --old old.dll --new new.dll
task run -- compare source.dll target.dll

# Run CI build sequence
task ci
Expand All @@ -76,22 +76,36 @@ task ci

```bash
# Basic comparison
dotnet run -- --old path/to/old/assembly.dll --new path/to/new/assembly.dll
dotnet run -- compare source.dll target.dll

# Generate JSON report
dotnet run -- --old old.dll --new new.dll --format json --output report.json
dotnet run -- compare source.dll target.dll --output json

# Show only breaking changes
dotnet run -- --old old.dll --new new.dll --breaking-only
# Generate markdown report
dotnet run -- compare source.dll target.dll --output markdown

# Filter to specific namespaces
dotnet run -- compare source.dll target.dll --filter System.Collections

# Use configuration file
dotnet run -- compare source.dll target.dll --config config.json

# Enable verbose output
dotnet run -- compare source.dll target.dll --verbose
```

## Command Line Options

- `--old, -o`: Path to the original assembly
- `--new, -n`: Path to the new assembly to compare against
- `--format, -f`: Output format (console, json, xml, html, markdown)
- `--output, -out`: Output file path (optional, defaults to console)
- `--breaking-only, -b`: Show only breaking changes
### Compare Command

- `<sourceAssembly>`: Path to the source/baseline assembly (required)
- `<targetAssembly>`: Path to the target/current assembly (required)
- `--config, -c`: Path to configuration file
- `--output, -o`: Output format (console, json, markdown)
- `--filter, -f`: Filter to specific namespaces (can be specified multiple times)
- `--exclude, -e`: Exclude types matching pattern (can be specified multiple times)
- `--no-color`: Disable colored output
- `--verbose, -v`: Enable verbose output
- `--help, -h`: Show help information

## Project Structure
Expand Down
58 changes: 56 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vars:
PROJECT: src/DotNetApiDiff/DotNetApiDiff.csproj
TEST_PROJECT: tests/DotNetApiDiff.Tests/DotNetApiDiff.Tests.csproj
COVERAGE_DIR: coverage-report
REPORT_DIR: reports
TEST_REPORT_DIR: test-report

tasks:
default:
Expand Down Expand Up @@ -52,6 +52,41 @@ tasks:
cmds:
- dotnet test {{.TEST_PROJECT}} --filter "Category=Integration" --configuration Release

test:report:
desc: Run tests with detailed HTML report
cmds:
- mkdir -p {{.TEST_REPORT_DIR}}
- dotnet test {{.TEST_PROJECT}} --results-directory {{.TEST_REPORT_DIR}} --logger "html;LogFileName=test-results.html"
- echo "Test report generated in {{.TEST_REPORT_DIR}}/test-results.html"

ensure-test-report:
desc: Ensure test report exists
internal: true
cmds:
- |
if [ ! -f "{{.TEST_REPORT_DIR}}/test-results.html" ]; then
echo "Test report not found. Generating it now..."
task test:report
fi

test:report:view:
desc: Open test report in default browser (generates report if it doesn't exist)
cmds:
- task: ensure-test-report
- |
{{if eq OS "windows"}}
cmd.exe /c start {{.TEST_REPORT_DIR}}/test-results.html
{{else if eq OS "darwin"}}
open {{.TEST_REPORT_DIR}}/test-results.html
{{else}}
xdg-open {{.TEST_REPORT_DIR}}/test-results.html
{{end}}

test:watch:
desc: Run tests in watch mode (rerun on file changes)
cmds:
- dotnet watch test --project {{.TEST_PROJECT}}

coverage:
desc: Generate code coverage report
cmds:
Expand All @@ -65,9 +100,28 @@ tasks:
- dotnet tool restore
- dotnet reportgenerator -reports:tests/DotNetApiDiff.Tests/coverage.info -targetdir:{{.COVERAGE_DIR}} -reporttypes:Html

coverage:report:detailed:
desc: Generate detailed HTML report with multiple formats
cmds:
- dotnet tool restore
- dotnet reportgenerator -reports:tests/DotNetApiDiff.Tests/coverage.info -targetdir:{{.COVERAGE_DIR}} -reporttypes:"Html;HtmlSummary;Cobertura;TextSummary"
- echo "Coverage report generated in {{.COVERAGE_DIR}}"
- cat {{.COVERAGE_DIR}}/Summary.txt

ensure-coverage-report:
desc: Ensure coverage report exists
internal: true
cmds:
- |
if [ ! -f "{{.COVERAGE_DIR}}/index.html" ]; then
echo "Coverage report not found. Generating it now..."
task coverage
fi

coverage:view:
desc: Open coverage report in default browser
desc: Open coverage report in default browser (generates report if it doesn't exist)
cmds:
- task: ensure-coverage-report
- |
{{if eq OS "windows"}}
cmd.exe /c start {{.COVERAGE_DIR}}/index.html
Expand Down
Loading
Loading