Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a75888c
Incorporating usage of spec element type
bendbennett Jun 6, 2023
88cfa48
Adding tests for custom types on elements
bendbennett Jun 6, 2023
8eca8e4
Updating ci-go.yml to use token for pulling modules from codegen-spec…
bendbennett Jun 6, 2023
f616f4e
Linting
bendbennett Jun 6, 2023
f685238
Merge branch 'main' into schema-provider-resources
bendbennett Jun 7, 2023
ea638cc
Using latest version of main and calling spec.Parse for validation an…
bendbennett Jun 7, 2023
237dd34
Switching to using HasImport available in spec
bendbennett Jun 7, 2023
a006f7a
Add handling of element type and attribute type into provider and res…
bendbennett Jun 7, 2023
d880e52
Add handling of default and plan modifier imports into resources
bendbennett Jun 8, 2023
aa76ba8
Switching to using HasImport() helper method
bendbennett Jun 8, 2023
b337d8c
Removing unused function
bendbennett Jun 8, 2023
4c3a606
Wiring-up addition of imports into schema template for provider and r…
bendbennett Jun 8, 2023
8226f2e
Removing unneeded schemaImport inclusion in import generation as the …
bendbennett Jun 8, 2023
c3863f1
Moving commands to separate directory
bendbennett May 30, 2023
a592e5d
Adding new line when object contains more than one attribute type
bendbennett Jun 8, 2023
ec90ac6
Adding copyright headers
bendbennett Jun 8, 2023
d734561
Handling custom type in schema generation for collection elements and…
bendbennett Jun 9, 2023
61a3099
Amending golangci configuration to skip output directory
bendbennett Jun 9, 2023
0654f06
Refactoring to used shared functions for spec schema ElementType and …
bendbennett Jun 9, 2023
ff9a2be
Merge branch 'main' into schema-provider-resources
bendbennett Jun 19, 2023
9401282
Updating package names to match module name
bendbennett Jun 19, 2023
4d1a19c
Removing unneeded import from schema.gotmpl for data source, provider…
bendbennett Jun 20, 2023
4933849
Adding nil check in template for custom field in plan modifier
bendbennett Jun 20, 2023
3aff33b
Adding nil check in template for custom field in validator
bendbennett Jun 20, 2023
acf6776
DRYing up usage of WriteString()
bendbennett Jun 20, 2023
8ca1800
Adding comment about the usage specschema types
bendbennett Jun 20, 2023
e8f2a3b
Using string quoting within fmt.Sprintf()
bendbennett Jun 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ linters:

run:
# Prevent false positive timeouts in CI
timeout: 5m
timeout: 5m
skip-dirs:
- output
31 changes: 5 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ facilitate the chaining together of CLI commands.
The following is a contrived example:

```shell
cat examples/ir.json | go run . schema
cat examples/ir.json | go run . all
```

An alternative is to use the `-input` flag to specify a file from which the IR can be read.

For example:

```shell
go run . schema -input examples/ir.json
go run . all -input examples/ir.json
```

Both cases will process `ir.json`.
Expand Down Expand Up @@ -51,27 +51,6 @@ The general flow is as follows:
* Write the formatted Go code, one file per data source, provider or resource, into
`generator/output`.

Currently, the only command that has been implemented is `schema`. This is a bit of a misnomer
as the `schema` command generates schema, models and model helper functions but _only_ for data
sources currently.

## Further Considerations

### Input

* Do we want to have the default for input for both the IR and the IR schema be stdin?

### Validate

* Do we want to improve the detail of the error messages that are generated when the IR is
not valid JSON or is this considered outside the scope of the IR2FCG?

### Generate

* Go code generation is leveraging [text/template](https://pkg.go.dev/text/template). Currently,
testing of the code generation is using files which contain a textual representation of the
expected generated code. This is quite difficult to visually inspect as no syntax highlighting
is provided by an IDE. Perhaps there's a better/easier way to handle this process?
* The templates that are used for generating Go code are `*.gotmpl` files which do not benefit
from Go syntax highlighting via an IDE. Again, perhaps there's a better/easier way to deal
with the templates.
Currently, the only command that has been implemented is `all`. This is a bit of a misnomer
as the `all` command only generates schema for data sources, provider and resources at
present.
Loading