Skip to content

fix(cli): wheels generate model writes misformatted CFC with orphan blank lines #2329

Closed

Description

@bpamiri

Summary

`wheels generate model ` produces a CFC with multiple orphan blank lines and inconsistent indentation inside `config()`. The tutorial chapter 2 tells users to overwrite the file immediately, so this isn't a tutorial blocker — but a user running the generator outside the tutorial flow gets oddly-formatted output.

Repro

$ wheels generate model Post title:string body:text
$ cat app/models/Post.cfc
component extends="Model" {
    function config() {



            validatesPresenceOf("title,body");
    }
}

Three orphan blank lines, and the `validatesPresenceOf` line has ~12-space indentation instead of the 8 spaces the surrounding lines use.

Expected

component extends="Model" {
    function config() {
        validatesPresenceOf("title,body");
    }
}

Suggested fix

The codegen template for the model body — likely under `cli/lucli/templates/codegen/Model*.txt` — has unconditional blank lines around optional sections (validations, associations, callbacks), and the validation line is indented from a deeper template context. Either trim leading/trailing blanks per-section in the template, collapse consecutive blank lines on render, or normalize indentation to the enclosing scope.

Severity

Minor (cosmetic). Tutorial users overwrite the file in the next step; non-tutorial users get odd-looking but functional code.

Source

Fresh-VM onboarding journal, 2026-04-27, finding #10.

Activity

  1. added a commit that references this issue on Apr 27, 2026
    ca5b3da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions