From 4b455f6e0fff6459b1f94dedffbb1c09fcc6084f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Kivim=C3=A4ki?= Date: Wed, 17 Jan 2024 12:34:51 +0200 Subject: [PATCH] chore: formatting improvements --- internal/cli/execute.go | 2 ++ internal/cli/test.go | 3 ++- pkg/recipe/test.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/cli/execute.go b/internal/cli/execute.go index aa1f8b94..3512046c 100644 --- a/internal/cli/execute.go +++ b/internal/cli/execute.go @@ -103,6 +103,8 @@ func runExecute(cmd *cobra.Command, opts executeOptions) error { cmd.Printf("%s: %s\n", opts.Colors.Red.Render("Description"), re.Metadata.Description) } + cmd.Println() + // Load all existing sauces existingSauces, err := recipe.LoadSauces(opts.Dir) if err != nil { diff --git a/internal/cli/test.go b/internal/cli/test.go index 425ed847..9b005309 100644 --- a/internal/cli/test.go +++ b/internal/cli/test.go @@ -144,7 +144,7 @@ func runTest(cmd *cobra.Command, opts testOptions) error { return nil } - cmd.Printf("Running tests for recipe \"%s\"...\n", re.Name) + cmd.Printf("Running tests for recipe \"%s\"...\n\n", re.Name) errs := re.RunTests() for i, err := range errs { symbol := '✅' @@ -163,6 +163,7 @@ func runTest(cmd *cobra.Command, opts testOptions) error { } if len(formattedErrs) > 0 { + cmd.Println() return fmt.Errorf("recipe tests failed: %w", errors.Join(formattedErrs...)) } diff --git a/pkg/recipe/test.go b/pkg/recipe/test.go index 8b088017..b7c1bef2 100644 --- a/pkg/recipe/test.go +++ b/pkg/recipe/test.go @@ -62,7 +62,7 @@ func (re *Recipe) RunTests() []error { continue } else { if !bytes.Equal(tFile.Content, file.Content) { - errors[i] = fmt.Errorf("%w: file '%s'.\nExpected:\n%s\n\nActual:\n%s", ErrTestContentMismatch, key, tFile, file.Content) + errors[i] = fmt.Errorf("%w: file '%s'.\nExpected:\n%s\n\nActual:\n%s", ErrTestContentMismatch, key, tFile.Content, file.Content) continue } }