diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19fce8f..49b2e53 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/losisin/helm-values-schema-json - rev: v1.5.0 + rev: v1.5.1 hooks: - id: helm-schema args: diff --git a/schema.yaml b/.schema.yaml similarity index 94% rename from schema.yaml rename to .schema.yaml index d17036d..b9b0f30 100644 --- a/schema.yaml +++ b/.schema.yaml @@ -1,6 +1,6 @@ # Required input: - - schema.yaml + - '.schema.yaml' draft: 2020 # @schema enum: [4, 6, 7, 2019, 2020]; default: 2020 indent: 4 # @schema default: 4 diff --git a/README.md b/README.md index 11646b7..b7569d1 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ First [install pre-commit](https://pre-commit.com/#install) and then create or u ```yaml repos: - repo: https://github.com/losisin/helm-values-schema-json - rev: v1.5.0 + rev: v1.5.1 hooks: - id: helm-schema args: ["-input", "values.yaml"] @@ -110,12 +110,12 @@ Usage: helm schema [options...] ### Configuration file -This plugin will look for it's configuration file called `schema.yaml` in the current working directory. All options available from CLI can be set in this file. Example: +This plugin will look for it's configuration file called `.schema.yaml` in the current working directory. All options available from CLI can be set in this file. Example: ```yaml # Required input: - - schema.yaml + - values.yaml draft: 2020 indent: 4 diff --git a/main.go b/main.go index d1e6e31..8c01b41 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( func main() { // Load configuration from a YAML file - fileConfig, err := pkg.LoadConfig("schema.yaml") + fileConfig, err := pkg.LoadConfig(".schema.yaml") if err != nil { fmt.Println("Error loading config file:", err) } diff --git a/main_test.go b/main_test.go index ff805c7..117170a 100644 --- a/main_test.go +++ b/main_test.go @@ -47,26 +47,26 @@ func TestMain(t *testing.T) { name: "ErrorLoadingConfigFile", args: []string{"schema", "-input", "testdata/basic.yaml"}, setup: func() { - if _, err := os.Stat("schema.yaml"); err == nil { - if err := os.Rename("schema.yaml", "schema.yaml.bak"); err != nil { + if _, err := os.Stat(".schema.yaml"); err == nil { + if err := os.Rename(".schema.yaml", ".schema.yaml.bak"); err != nil { log.Fatalf("Error renaming file: %v", err) } } - file, _ := os.Create("schema.yaml") + file, _ := os.Create(".schema.yaml") defer file.Close() if _, err := file.WriteString("draft: invalid\n"); err != nil { log.Fatalf("Error writing to file: %v", err) } }, cleanup: func() { - if _, err := os.Stat("schema.yaml.bak"); err == nil { - os.Remove("schema.yaml") - if err := os.Rename("schema.yaml.bak", "schema.yaml"); err != nil { + if _, err := os.Stat(".schema.yaml.bak"); err == nil { + os.Remove(".schema.yaml") + if err := os.Rename(".schema.yaml.bak", ".schema.yaml"); err != nil { log.Fatalf("Error renaming file: %v", err) } } else { - os.Remove("schema.yaml") + os.Remove(".schema.yaml") } }, expectedOut: "", diff --git a/plugin.yaml b/plugin.yaml index cbcdae4..684b98d 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "schema" -version: "1.5.0" +version: "1.5.1" usage: "generate values.schema.json from values yaml" description: "Helm plugin for generating values.schema.json from multiple values files." ignoreFlags: false