-
-
Notifications
You must be signed in to change notification settings - Fork 8
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: dfed/SafeDI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.0-alpha-3
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: dfed/SafeDI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.0.0-alpha-4
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 3 commits
- 13 files changed
- 2 contributors
Commits on Apr 5, 2026
-
Configuration menu - View commit details
-
Copy full SHA for d43c295 - Browse repository at this point
Copy the full SHA d43c295View commit details -
Allow mock() to return fulfillingAdditionalTypes with return-type-awa…
…re dispatch (#213) ## Summary - Mock return type validation now accepts types listed in `fulfillingAdditionalTypes` in addition to the declaring type - On concrete types: `Self`, the type name, or any additional type - On extensions: the extended type or any additional type - The generator checks `mockReturnType` against the property type before deciding to call `.mock` vs `init`/`instantiate` — a mock returning `MyServiceProtocol` is used when the parent's property is `MyServiceProtocol`, but falls through to `init`/`instantiate` when the parent needs the concrete `MyService` - Adds `mockReturnType: TypeDescription?` to `Instantiable` and `mockReturnTypeIsCompatible(withPropertyType:)` to encapsulate the dispatch logic - Updates the manual to document additional type return rules ## Test plan - [x] `mockMethodReturningAdditionalTypeProducesNoDiagnostic` — concrete type returning a protocol from `fulfillingAdditionalTypes` (macro validation) - [x] `extension_mockMethodReturningAdditionalTypeProducesNoDiagnostic` — extension returning a protocol from `fulfillingAdditionalTypes` (macro validation) - [x] `mock_userMockReturningAdditionalTypeUsedForProtocolProperty` — concrete: generator uses `.mock` when property is the protocol type - [x] `mock_userMockReturningAdditionalTypeNotUsedForConcreteProperty` — concrete: generator falls through to `init` when property is the concrete type - [x] `mock_extensionUserMockReturningAdditionalTypeUsedForProtocolProperty` — extension: generator uses `.mock` when property is the protocol type - [x] `mock_extensionUserMockReturningAdditionalTypeNotUsedForConcreteProperty` — extension: generator falls through to `.instantiate` when property is the concrete type - [x] All 709 tests pass - [x] Lint passes - [x] Coverage: all new code fully covered 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 6dd6df9 - Browse repository at this point
Copy the full SHA 6dd6df9View commit details -
Error when generateMock: true conflicts with user-defined mock method (…
…#214) ## Summary - When an `@Instantiable` type has both `generateMock: true` and a hand-written `mock()` method, the macro now emits a compile-time error with a fix-it to remove `generateMock: true`. - Previously this was silently handled at the tool level (skipping generation). Now it's caught early with a clear diagnostic. - Applies to both concrete type declarations and extension-based `@Instantiable` types. ## Test plan - [x] `producesDiagnostic_whenGenerateMockIsTrueAndUserDefinedMockExists` — single-argument attribute, fix-it removes entire argument clause - [x] `producesDiagnostic_whenGenerateMockIsTrueAndUserDefinedMockExistsWithOtherArguments` — multi-argument attribute, fix-it removes only `generateMock: true` - [x] `mockMethodConflictsWithGenerateMock_description_mentionsBothGenerateMockAndMockMethod` - [x] `mockMethodConflictsWithGenerateMock_fixIt_mentionsRemovingGenerateMock` - [x] Full test suite passes (709 tests) - [x] SwiftFormat clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for a1c24df - Browse repository at this point
Copy the full SHA a1c24dfView commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 2.0.0-alpha-3...2.0.0-alpha-4