-
Notifications
You must be signed in to change notification settings - Fork 0
Add namespace and type mapping capabilities #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add INameMapper interface for mapping namespaces and type names - Implement NameMapper class with support for one-to-many mappings - Integrate mapping logic into ApiComparer workflow - Add unit tests for various mapping scenarios - Update existing tests to work with the new NameMapper dependency Resolves task 4.2
Signed-off-by: jbrinkman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements comprehensive namespace and type mapping capabilities for the dotnet-api-diff tool, enabling comparison of types across renamed namespaces and different organizational structures.
- Adds
INameMapperinterface andNameMapperimplementation supporting one-to-many mappings and auto-mapping - Integrates name mapping logic into
ApiComparerto handle namespace transformations during comparisons - Updates dependency injection configuration to register the NameMapper service
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/DotNetApiDiff.Tests/ApiExtraction/NameMapperTests.cs | Comprehensive unit tests for NameMapper functionality |
| tests/DotNetApiDiff.Tests/ApiExtraction/ApiComparerWithMappingTests.cs | Integration tests for ApiComparer with mapping capabilities |
| tests/DotNetApiDiff.Tests/ApiExtraction/ApiComparerTests.cs | Updated constructor to include INameMapper dependency |
| tests/DotNetApiDiff.Tests/ApiExtraction/ApiComparerManualTests.cs | Added mock NameMapper to manual test setup |
| src/DotNetApiDiff/Program.cs | Registered NameMapper in dependency injection container |
| src/DotNetApiDiff/Interfaces/INameMapper.cs | Interface definition for namespace and type mapping operations |
| src/DotNetApiDiff/ApiExtraction/NameMapper.cs | Core implementation of mapping logic with configuration support |
| src/DotNetApiDiff/ApiExtraction/ApiComparer.cs | Integrated name mapping into type comparison workflow |
| .kiro/specs/dotnet-api-diff/tasks.md | Updated task completion status |
|
I've addressed both code review comments:
These changes improve code readability and reduce duplication while maintaining the same functionality. |
jbrinkman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've addressed all the code review comments by extracting helper methods to reduce code duplication. The changes maintain the same functionality while improving code readability and maintainability.
chore: update .editorconfig to disable additional analyzers
This PR implements task 4.2 "Add namespace and type mapping capabilities" from the dotnet-api-diff spec.
Changes
INameMapperinterface for mapping namespaces and type namesNameMapperclass with support for:ApiComparerclass to use the NameMapperTesting
All tests are passing, including the existing tests that were updated to include the NameMapper parameter.
Closes #4.2