Skip to content

[FEAT] CLI for Generation#5

Merged
bbengfort merged 1 commit intomainfrom
genjen
Apr 4, 2026
Merged

[FEAT] CLI for Generation#5
bbengfort merged 1 commit intomainfrom
genjen

Conversation

@bbengfort
Copy link
Copy Markdown
Contributor

@bbengfort bbengfort commented Apr 4, 2026

Scope of changes

Adds a CLI for code generation.

Estimated PR Size:

  • Tiny
  • Small
  • Medium
  • Large
  • Huge

Acceptance criteria

This PR will be merged without review.

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have added new test fixtures as needed to support added tests
  • I have added or updated the documentation
  • I have run go generate to update generated code

Note

Medium Risk
Introduces a new cmd/enumify entrypoint and new generation APIs, which may affect go generate workflows and downstream usage, but the implementation is mostly wiring/scaffolding with minimal business logic so far.

Overview
Adds a real enumify CLI intended for go generate, with flag-driven options to enable/disable specific generated outputs and a -version mode plus custom usage text.

Introduces an enumify.Options struct and new library entrypoints (Generate, GenerateTests, and GenerateComment) along with a semver-based Version() implementation; adds a small test to ensure the generated-code header matches Go’s required DO NOT EDIT pattern and pulls in go.rtnl.ai/x for semver support.

Reviewed by Cursor Bugbot for commit 35f45b4. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a 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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 35f45b4. Configure here.

}

func Generate(opts Options) error {
fmt.Printf("%+v\n", opts)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug print statement left in production code

Medium Severity

Generate() contains a fmt.Printf("%+v\n", opts) debug statement that prints the full options struct to stdout. Every invocation of go generate will emit this noise to the terminal. This looks like a leftover from development/debugging that was unintentionally committed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 35f45b4. Configure here.


func GenerateComment() string {
return fmt.Sprintf("Code generated by enumify v%s. DO NOT EDIT.", Version())
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated comment missing Go-convention // prefix

Medium Severity

GenerateComment() returns "Code generated by enumify v… DO NOT EDIT." without the // prefix. The Go specification requires generated files to contain a line matching ^// Code generated .* DO NOT EDIT\.$. The test's own documentation quotes this pattern, but the test regex omits the // prefix, so the test passes despite the output not conforming to Go convention. Generated files won't be recognized as such by Go tools.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 35f45b4. Configure here.

@bbengfort bbengfort merged commit 3f46322 into main Apr 4, 2026
7 checks passed
@bbengfort bbengfort deleted the genjen branch April 4, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant