-
-
Notifications
You must be signed in to change notification settings - Fork 170
Test file val keyword #181
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
base: main
Are you sure you want to change the base?
Conversation
Replace Kotlin 'val' keyword with Swift 'let' during template processing. This prevents compilation errors when scaffolding iOS/macOS projects. - Added fixSwiftSyntax() to convert 'val' to 'let' in Swift files - Applied fix to both iOS and macOS scaffold processing - Added tests to verify the fix works correctly - Updated CHANGELOG.md Fixes XCODEBUILD-MCP-132X
|
Cursor Agent can help with this pull request. Just |
commit: |
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| result = result.replace(/\bval\s+(\w+)\s*=/g, 'let $1 ='); | ||
|
|
||
| return result; | ||
| } |
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.
Duplicated fixSwiftSyntax function across scaffolding files
Low Severity
The fixSwiftSyntax function is duplicated identically in both scaffold_ios_project.ts and scaffold_macos_project.ts. Both implementations contain the same regex replacement logic (/\bval\s+(\w+)\s*=/g → let $1 =). This duplication increases maintenance burden and risks inconsistent bug fixes if the logic needs to be updated in the future—a fix applied to one file might be forgotten in the other.
Additional Locations (1)
| // Apply Swift syntax fixes if this is a Swift file | ||
| if (isSwiftFile) { | ||
| processedContent = fixSwiftSyntax(processedContent); | ||
| } |
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.
Swift syntax fix skipped when customizeNames is false
Low Severity
The fixSwiftSyntax call is inside the if (isTextFile && customizeNames) block. When a user scaffolds with customizeNames: false, Swift files are copied via cp in the else branch, completely bypassing the syntax fix. This means the Kotlin val syntax error would persist in the output files, defeating the purpose of the fix ("prevent compilation errors") for users who explicitly set customizeNames: false.
Replaces Kotlin's
valkeyword with Swift'sletin scaffolded Swift files to prevent compilation errors. Fixes XCODEBUILD-MCP-132X.Note
Ensures scaffolded Swift sources compile by correcting Kotlin-style
valto Swiftlet.fixSwiftSyntaxapplied to.swiftfiles inscaffold_ios_project.tsandscaffold_macos_project.tsCHANGELOG.mdwith the fix reference (XCODEBUILD-MCP-132X)Written by Cursor Bugbot for commit debd3f2. This will update automatically on new commits. Configure here.