♻️ Convert Model generator to Stencil template#182
Open
MadsBogeskov wants to merge 1 commit intoios-431-convert-enumeration-generator-to-stencil-template-v2from
Conversation
This was referenced Mar 16, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
ea90dad to
ba38e2b
Compare
ef50499 to
4c4d9d2
Compare
[IOS-432](https://linear.app/lunar/issue/IOS-432) Amp-Thread-ID: https://ampcode.com/threads/T-019ce779-e5d2-72f8-98ed-dcf8f0377774 Co-authored-by: Amp <amp@ampcode.com>
ba38e2b to
33955f7
Compare
4c4d9d2 to
21994cf
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.

Problem
Model.toSwift() uses inline string interpolation for the file wrapper.
Solution
Extract file wrapper to Model.stencil, keep complex body logic in Swift.
Testing
All 70 tests pass including golden file tests.
Stack
#169 → #179 → #180 → #181 → this PR → …
IOS-432
Note
Low Risk
Low risk refactor that changes how model Swift source is wrapped (imports/extension/#if DEBUG) but not the generated model body logic; main risk is subtle whitespace/format differences affecting generated output or golden tests.
Overview
Refactors
Model.toSwift()to stop building the outer Swift file via manual string concatenation and instead render a newModel.stenciltemplate.The template now controls imports, optional
extension {{ serviceName }}wrapping/indentation, and#if DEBUGgating forisInternalOnly, while Swift continues to generate the coremodelBodyand passes rendering context (embedded,packagesToImport, etc.) into the template renderer.Written by Cursor Bugbot for commit 21994cf. This will update automatically on new commits. Configure here.