From 1b7310545722e0cf48190f9ae97a77c968222a4c Mon Sep 17 00:00:00 2001 From: Ilya Kuznetsov Date: Wed, 15 Jan 2025 16:26:19 +0100 Subject: [PATCH] fix: Split annotations/main.go in 2 files --- bundle/internal/annotation/descriptor.go | 12 ++++++++++ .../internal/annotation/{main.go => file.go} | 22 +++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 bundle/internal/annotation/descriptor.go rename bundle/internal/annotation/{main.go => file.go} (56%) diff --git a/bundle/internal/annotation/descriptor.go b/bundle/internal/annotation/descriptor.go new file mode 100644 index 000000000..26c1a0b06 --- /dev/null +++ b/bundle/internal/annotation/descriptor.go @@ -0,0 +1,12 @@ +package annotation + +type Descriptor struct { + Description string `json:"description,omitempty"` + MarkdownDescription string `json:"markdown_description,omitempty"` + Title string `json:"title,omitempty"` + Default any `json:"default,omitempty"` + Enum []any `json:"enum,omitempty"` + MarkdownExamples string `json:"markdown_examples,omitempty"` +} + +const Placeholder = "PLACEHOLDER" diff --git a/bundle/internal/annotation/main.go b/bundle/internal/annotation/file.go similarity index 56% rename from bundle/internal/annotation/main.go rename to bundle/internal/annotation/file.go index 0053e16c9..0317f441a 100644 --- a/bundle/internal/annotation/main.go +++ b/bundle/internal/annotation/file.go @@ -10,21 +10,11 @@ import ( "github.com/databricks/cli/libs/dyn/yamlloader" ) -type Descriptor struct { - Description string `json:"description,omitempty"` - MarkdownDescription string `json:"markdown_description,omitempty"` - Title string `json:"title,omitempty"` - Default any `json:"default,omitempty"` - Enum []any `json:"enum,omitempty"` - MarkdownExamples string `json:"markdown_examples,omitempty"` -} - -/** - * Parsed file with annotations, expected format: - * github.com/databricks/cli/bundle/config.Bundle: - * cluster_id: - * description: "Description" - */ +// Parsed file with annotations, expected format: +// github.com/databricks/cli/bundle/config.Bundle: +// +// cluster_id: +// description: "Description" type File map[string]map[string]Descriptor func LoadAndMerge(sources []string) (File, error) { @@ -52,5 +42,3 @@ func LoadAndMerge(sources []string) (File, error) { } return data, nil } - -const Placeholder = "PLACEHOLDER"