From 0bd800ac7302ef80019c9da1473705336e168c30 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Mon, 12 Dec 2022 15:53:25 +0100 Subject: [PATCH] sort envvars by name Signed-off-by: jkoberg --- docs/helpers/global_vars.yaml | 44 ++++++++++++++++----------------- docs/helpers/rogueEnv.go | 7 ++++++ docs/templates/ADOC_global.tmpl | 4 ++- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/docs/helpers/global_vars.yaml b/docs/helpers/global_vars.yaml index 290a90ceca..2f0de5386e 100644 --- a/docs/helpers/global_vars.yaml +++ b/docs/helpers/global_vars.yaml @@ -7,22 +7,6 @@ variables: default_value: "" description: "" do_ignore: false -- rawname: registryAddressEnv - path: ocis-pkg/registry/registry.go:42 - foundincode: true - name: registryAddressEnv - type: "" - default_value: "" - description: "" - do_ignore: false -- rawname: MICRO_LOG_LEVEL - path: ocis-pkg/log/log.go:34 - foundincode: true - name: MICRO_LOG_LEVEL - type: "" - default_value: "" - description: "" - do_ignore: false - rawname: CS3_MACHINE_AUTH_API_KEY path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77 foundincode: true @@ -31,10 +15,18 @@ variables: default_value: "" description: "" do_ignore: false -- rawname: registryEnv - path: ocis-pkg/registry/registry.go:44 +- rawname: MICRO_LOG_LEVEL + path: ocis-pkg/log/log.go:34 foundincode: true - name: registryEnv + name: MICRO_LOG_LEVEL + type: "" + default_value: "" + description: "" + do_ignore: false +- rawname: MICRO_LOG_LEVEL + path: ocis-pkg/log/log.go:30 + foundincode: true + name: MICRO_LOG_LEVEL type: "" default_value: "" description: "" @@ -63,10 +55,18 @@ variables: default_value: "" description: "" do_ignore: false -- rawname: MICRO_LOG_LEVEL - path: ocis-pkg/log/log.go:30 +- rawname: registryAddressEnv + path: ocis-pkg/registry/registry.go:42 foundincode: true - name: MICRO_LOG_LEVEL + name: registryAddressEnv + type: "" + default_value: "" + description: "" + do_ignore: false +- rawname: registryEnv + path: ocis-pkg/registry/registry.go:44 + foundincode: true + name: registryEnv type: "" default_value: "" description: "" diff --git a/docs/helpers/rogueEnv.go b/docs/helpers/rogueEnv.go index f61958a7a4..ec177bd4cb 100644 --- a/docs/helpers/rogueEnv.go +++ b/docs/helpers/rogueEnv.go @@ -8,6 +8,7 @@ import ( "os/exec" "path/filepath" "regexp" + "sort" "strings" "text/template" @@ -117,6 +118,12 @@ func GetRogueEnvs() { vars.Variables = append(vars.Variables, v) } + less := func(i, j int) bool { + return vars.Variables[i].Name < vars.Variables[j].Name + } + + sort.Slice(vars.Variables, less) + output, err := yaml.Marshal(vars) if err != nil { log.Fatal(err) diff --git a/docs/templates/ADOC_global.tmpl b/docs/templates/ADOC_global.tmpl index ae388a5d5f..45f6af9629 100644 --- a/docs/templates/ADOC_global.tmpl +++ b/docs/templates/ADOC_global.tmpl @@ -14,13 +14,15 @@ {{- if .Ignore }} {{ continue }} {{- end }} + a| `{{- .Name }}` + a| [subs=-attributes] ++{{ .Type }} ++ a| [subs=-attributes] ++{{.DefaultValue}} ++ a| [subs=-attributes] -{{.Description}} +++{{.Description}} ++ +a| [subs=-attributes] {{- end }} |===