Skip to content

Rename SafeDIParameters to SafeDIOverrides and add doc comments to generated mock types#244

Merged
dfed merged 1 commit into
mainfrom
rename-safedi-overrides
Apr 11, 2026
Merged

Rename SafeDIParameters to SafeDIOverrides and add doc comments to generated mock types#244
dfed merged 1 commit into
mainfrom
rename-safedi-overrides

Conversation

@dfed
Copy link
Copy Markdown
Owner

@dfed dfed commented Apr 10, 2026

Summary

  • Renames SafeDIParametersSafeDIOverrides (type and safeDIOverrides: argument label) so the generated type name communicates its purpose: overriding defaults in the mock dependency tree
  • Adds /// doc comments to generated SafeDIOverrides, SafeDIMockConfiguration, and safeDIBuilder so users get useful autocomplete tooltips
  • Adds missing additionalMocksToGenerate to the #SafeDIConfiguration source doc comment
  • Expands manual documentation for safeDIBuilder to explain it overrides/customizes how a type is constructed, with parameters matching init or custom mock method

Test plan

  • All 742 tests pass
  • SwiftFormat lint passes
  • Verify generated output in a real project uses SafeDIOverrides and shows doc comments

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.91%. Comparing base (9541bd4) to head (0bf5c6b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #244   +/-   ##
=======================================
  Coverage   99.91%   99.91%           
=======================================
  Files          41       41           
  Lines        5796     5799    +3     
=======================================
+ Hits         5791     5794    +3     
  Misses          5        5           
Files with missing lines Coverage Δ
Sources/SafeDICore/Generators/ScopeGenerator.swift 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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>
@dfed dfed force-pushed the rename-safedi-overrides branch from 921b64b to 0bf5c6b Compare April 10, 2026 22:54
@dfed dfed self-assigned this Apr 11, 2026
@dfed dfed marked this pull request as ready for review April 11, 2026 06:30
@dfed dfed merged commit 065544c into main Apr 11, 2026
17 checks passed
@dfed dfed deleted the rename-safedi-overrides branch April 11, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant