Fix Kotlin CLI integer type generation#1557
Conversation
Greptile SummaryThis PR fixes a type mismatch in the Kotlin CLI type generator by mapping
Confidence Score: 5/5Safe to merge — the core fix is a straightforward one-liner and the new regression test locks in the correct behaviour. The The hardcoded Important Files Changed
Reviews (2): Last reviewed commit: "fix: emit Long for Kotlin integer attrib..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Updates the CLI’s Kotlin type-generation to treat integer attributes as Long (aligning with Kotlin/Android SDK expectations), and adds a regression test to ensure the CLI-generated Kotlin models keep using Long? for nullable integers. It also broadens CLI config include-path typing to accept resource path keys used by site/function commands in stricter Bun/TypeScript builds.
Changes:
- Map Kotlin CLI
AttributeType.INTEGERtoLonginstead ofInt. - Add a CLI regression test that generates Kotlin table row types from an
integercolumn and assertsLong?(notInt?). - Widen config resource-path typing (
ConfigIncludePaths/getResourceDirname/resolveResourcePath) to accept"functions"and"sites"keys.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/languages/cli/test.js | Adds a Kotlin CLI typegen regression (and a stdout mute helper) to assert integer columns generate Long?. |
| templates/cli/lib/type-generation/languages/kotlin.ts | Switches Kotlin integer attribute mapping from Int to Long. |
| templates/cli/lib/config.ts | Expands resource path key typing used for resolving include/resource paths for functions/sites commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e3c3714 to
b08e5ee
Compare
Summary
Longinstead ofInt, matching Kotlin/Android SDK models.Long, notInt.sitesis part ofConfigResourceKeyeven when a test spec omits the Sites service; this keeps copied CLI command files type-checking from the real config schema keys.Test plan
php example.php clivendor/bin/phpunit --filter 'CLIBun10Test|CLIBun11Test|CLIBun13Test' tests/CLIBun10Test.php tests/CLIBun11Test.php tests/CLIBun13Test.php\n-/tmp/codex-djlint-sdk-generator/bin/djlint templates/ --lint\n-composer lint\n-git diff --check\n\nNote: this repo hasmasteras the default branch and noorigin/main, so the PR targetsmaster.