Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Inconsistency in tuist init when no name specified #3811

@ezraberch

Description

@ezraberch

tuist init
tuist init --template default
tuist init -t default
tuist init --template swiftui (Error: Missing expected argument '--name <name>')
tuist init -t swiftui

Both the default and swiftui templates define the attribute the same way:

let nameAttribute: Template.Attribute = .required("name")

Since the attribute is defined as required, all 5 above cases should fail with the "missing expected argument" error. However, there is special logic excluding the default template from the validation check. There is also special logic which properly sets name when it is unspecified. Additionally, there is a bug which skips the check when using the -t form of the argument.

It makes sense to allow custom templates to use the automatic name just like the default template can. However, it seems strange to use the .required syntax for an attribute which is not actually required.

Metadata

Metadata

Assignees

Labels

type:bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions