-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default to generating directory and package per data source, provider and resource #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 🚀
I imagine "naming collisions" will get a documentation section all to itself 😆
@@ -11,7 +11,6 @@ import ( | |||
"github.com/google/go-cmp/cmp" | |||
) | |||
|
|||
// TODO: currently doesn't compare nested directory files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! 😎
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
References: #20
The changes in this PR implement the following behaviour:
--package
flag is omitted when executing thegenerate
command, a directory and package will be generated for each data source, provider and resource that is defined within the intermediate representation / spec.--package
flag is included when executing thegenerate
command, all generated code will be placed in the same directory and package.Default Behaviour (--package flag omitted)
For example, if we have an intermediate representation / spec that defines the following data source, provider, and resource:
Executing the following generate command:
Generates the following output:
The package within each of the three files is then:
package datasource_example
package provider_example
package resource_example
Package Specified (--package flag defined)
Conversely, if the same intermediate representation / spec illustrated above is passed to the generate command, and the
--package
flag is specified, for instance:The following output is generated:
The package in all three files is then:
package specified