Rename SafeDIParameters to SafeDIOverrides and add doc comments to generated mock types#244
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #244 +/- ##
=======================================
Coverage 99.91% 99.91%
=======================================
Files 41 41
Lines 5796 5799 +3
=======================================
+ Hits 5791 5794 +3
Misses 5 5
🚀 New features to boost your workflow:
|
…nerated mock types
Rename the root mock parameter struct from `SafeDIParameters` to
`SafeDIOverrides` so the type name communicates its purpose — overriding
defaults in the mock dependency tree. The argument label becomes
`safeDIOverrides:` (with the `safeDI` prefix to prevent collisions with
user-defined properties).
Add `///` doc comments to the generated `SafeDIOverrides`,
`SafeDIMockConfiguration`, and `safeDIBuilder` declarations so users get
useful tooltips from autocomplete without consulting the manual.
The `safeDIBuilder` doc comment says "the default generated construction
function is used" (not "the default initializer") since the fallback may
be a `customMockName` method or `instantiate(...)`.
Also fixes:
- Missing `additionalMocksToGenerate` in `#SafeDIConfiguration` source doc
- Manual's `safeDIBuilder` section now explains it overrides construction
with parameters matching init or custom mock method
- Manual's leaf override example uses the real simple-closure shape
(not `.init { }` which implies a config object)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
921b64b to
0bf5c6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SafeDIParameters→SafeDIOverrides(type andsafeDIOverrides:argument label) so the generated type name communicates its purpose: overriding defaults in the mock dependency tree///doc comments to generatedSafeDIOverrides,SafeDIMockConfiguration, andsafeDIBuilderso users get useful autocomplete tooltipsadditionalMocksToGenerateto the#SafeDIConfigurationsource doc commentsafeDIBuilderto explain it overrides/customizes how a type is constructed, with parameters matching init or custom mock methodTest plan
SafeDIOverridesand shows doc comments🤖 Generated with Claude Code