feat(cli): Rails-style column size modifiers for generators - #3560
Merged
Conversation
Generator property tokens accept string{N} and decimal{P,S} braces.
parseGeneratorArgs stores limit / precision / scale on the prop, and
generated migrations use those overrides instead of the hardcoded
string 255 / integer 11 / decimal 10,2 defaults.
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Peter Amiri <peter@alurium.com>
Pin title:string{50} → limit 50, price:decimal{10,2} → precision/scale,
bare title:string still 255, and status:enum:a,b values unchanged.
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Peter Amiri <peter@alurium.com>
Add the brace syntax to the property type table, a quoted-shell example, and a changelog fragment. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Peter Amiri <peter@alurium.com>
bpamiri
marked this pull request as ready for review
September 9, 2026 19:02
15 tasks
bpamiri
added a commit
that referenced
this pull request
Sep 9, 2026
Follow-up to #3560. String-like \`{n}\` modifiers now also emit \`validatesLengthOf(property=..., maximum=n)\` on the generated model. Bare types and integer/decimal braces are unchanged.
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
CLI generators (
model,scaffold,api-resource) now accept Rails-style column size modifiers on property tokens:Generated migrations emit the custom
limit/precision/scaleinstead of the hardcoded defaults (string 255, integer 11, decimal 10/2).Related Issue
N/A — requested as a v1 generator enhancement.
Type of Change
Behavior
title:string{50}t.string(..., limit='50')price:decimal{10,2}t.decimal(..., precision='10', scale='2')title:string(no braces)t.string(..., limit='255')(unchanged default)status:enum:draft,publishedvalues— braces do not steal the colon listThe same
{N}limit parsing applies tointeger,text,binary, andvarcharaliases when they map through the migration emitter.Not in this PR:
:uniq/:indexsuffixes, bang!fornull:false, key-value brace options.Feature Completeness Checklist
Signed-off-by:ParseGeneratorArgsSpec+ScaffoldSpeccover brace parse + migration emit, plus enum regressionweb/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/code-generation.mdx(property type table + quoted-shell example)changelog.d/cli-column-size-modifiers.added.mdParseGeneratorArgsSpec8 +ScaffoldSpec45)Test Plan
title:string{50}→limit50price:decimal{10,2}→ precision 10, scale 2title:stringstill 255status:enum:a,bstill parses valuesParseGeneratorArgsSpec+ScaffoldSpec(53 pass)python3 tools/code-quality/cfml-complexity.py cli/lucli --gate 30 --baseline tools/code-quality/baseline-cli.jsonpasses