WIP: minor improvements #397

Draft
wykwit wants to merge 7 commits from wykwit/abra:minor-improvements into main
1 changed files with 3 additions and 4 deletions
Showing only changes of commit 3fd249b0d8 - Show all commits

View File

@ -5,7 +5,6 @@ import (
"coopcloud.tech/abra/pkg/autocomplete"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/formatter"
"coopcloud.tech/abra/pkg/recipe"
recipePkg "coopcloud.tech/abra/pkg/recipe"
Review

I think "coopcloud.tech/abra/pkg/recipe" should be the preferd way to import the package. Or is there a specific reason why you changed the import everywhere?

I think `"coopcloud.tech/abra/pkg/recipe"` should be the preferd way to import the package. Or is there a specific reason why you changed the import everywhere?
Review

I changed it wherever there was a double import, because in some places recipe can either be a variable or a package. It was used inconsistently within those source files, referring to the package sometimes as recipePkg and sometimes as just recipe which is additionally confusing when recipe is also used there as a common variable name. There are still some other places where the import is not renamed, but when the package name gets overshadowed it's not used anymore.

I changed it wherever there was a double import, because in some places `recipe` can either be a variable or a package. It was used inconsistently within those source files, referring to the package sometimes as `recipePkg` and sometimes as just `recipe` which is additionally confusing when `recipe` is also used there as a common variable name. There are still some other places where the import is not renamed, but when the package name gets overshadowed it's not used anymore.
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
@ -38,7 +37,7 @@ ${FOO:<default>} syntax). "check" does not confirm or deny this for you.`,
Action: func(c *cli.Context) error {
app := internal.ValidateApp(c)
if err := recipe.EnsureExists(app.Recipe); err != nil {
if err := recipePkg.EnsureExists(app.Recipe); err != nil {
logrus.Fatal(err)
}
@ -68,9 +67,9 @@ ${FOO:<default>} syntax). "check" does not confirm or deny this for you.`,
for _, envVar := range envVars {
if envVar.Present {
table.Append([]string{envVar.Name, "✅"})
table.Append([]string{envVar.Name, "✅ OK"})
} else {
table.Append([]string{envVar.Name, "❌"})
table.Append([]string{envVar.Name, "❌ Missing"})
}
}