Skip to content

Commit e338159

Browse files
authored
[Internal] Move templates in the code generator (#1075)
## Changes <!-- Summary of your changes that are easy to understand --> Move templates in the code generator. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> The generator is working correctly with the new configuration.
1 parent e873ca2 commit e338159

14 files changed

+2
-1165
lines changed

.codegen.json

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
{
2-
"formatter": "go fmt ./... && go run golang.org/x/tools/cmd/goimports@latest -w $FILENAMES",
2+
"mode": "go_v0",
33
"changelog_config": ".codegen/changelog_config.yml",
4-
"packages": {
5-
".codegen/api.go.tmpl": "service/{{.Name}}/api.go",
6-
".codegen/impl.go.tmpl": "service/{{.Name}}/impl.go",
7-
".codegen/interface.go.tmpl": "service/{{.Name}}/interface.go",
8-
".codegen/model.go.tmpl": "service/{{.Name}}/model.go"
9-
},
10-
"batch": {
11-
".codegen/workspaces.go.tmpl": "workspace_client.go",
12-
".codegen/accounts.go.tmpl": "account_client.go",
13-
".codegen/service-pkg.go.tmpl": "service/pkg.go",
14-
".codegen/error_mapping.go.tmpl": "apierr/error_mapping.go",
15-
".codegen/error_overrides.go.tmpl": "apierr/error_overrides.go",
16-
".codegen/error_alias.go.tmpl": "error_alias.go",
17-
".codegen/mock_workspace_client.go.tmpl": "experimental/mocks/mock_workspace_client.go",
18-
".codegen/mock_account_client.go.tmpl": "experimental/mocks/mock_account_client.go"
19-
},
20-
"examples": {
21-
".codegen/examples_test.go.tmpl": "service/{{.Package}}/{{.SnakeName}}_usage_test.go"
22-
},
234
"version": {
245
"version/version.go": "const Version = \"$VERSION\""
256
},
@@ -28,6 +9,7 @@
289
"go"
2910
],
3011
"post_generate": [
12+
"make fmt",
3113
"go run github.com/vektra/mockery/v2@0229bd4bb4357cd09af7ac15ecab85022d296b12"
3214
]
3315
}

.codegen/accounts.go.tmpl

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)