hofstadter-io / hof

Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.
https://docs.hofstadter.io
Apache License 2.0
523 stars 37 forks source link

hof/gen: init fails when module has hyphen in the name #129

Closed verdverm closed 1 year ago

verdverm commented 1 year ago
$ hof gen --init hof.io/docs/first-example
Initializing: hof.io/docs/first-example in pkg first-exampleparse: expected ',', found '-'

Found from debugging: https://github.com/hofstadter-io/hof-docs/issues/15

I believe this is because the top-level cue file is generated with package first-example which is invalid syntax.

Solutions, by my preference:

  1. snake_case the package name
  2. make the top-level package main
  3. do not allow hyphenated names (not really an option tbh, but putting here to show it was considered and rejected)
verdverm commented 1 year ago

Fixed in https://github.com/hofstadter-io/hof/commit/b18b5a508c8374d3588d21f01692e5a4bba4b6a1