From 96b162b92c416e868f4a0a98dd55c03e067eb744 Mon Sep 17 00:00:00 2001 From: Abhishek Pattanayak Date: Sun, 8 Mar 2026 15:14:25 +0000 Subject: [PATCH 1/3] fix(env): change parseEnvKeys return type to map[string]string and also store values --- internal/check/env.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/check/env.go b/internal/check/env.go index 932eb9b..c480f1f 100644 --- a/internal/check/env.go +++ b/internal/check/env.go @@ -59,24 +59,25 @@ func (c *EnvCheck) Run(_ context.Context) Result { } } -func parseEnvKeys(path string) (map[string]struct{}, error) { +func parseEnvKeys(path string) (map[string]string, error) { f, err := os.Open(path) if err != nil { return nil, err } defer f.Close() - keys := make(map[string]struct{}) + keys := make(map[string]string) scanner := bufio.NewScanner(f) for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) if line == "" || strings.HasPrefix(line, "#") { continue } - key, _, _ := strings.Cut(line, "=") + key, val, _ := strings.Cut(line, "=") key = strings.TrimSpace(key) + val = strings.TrimSpace(val) if key != "" { - keys[key] = struct{}{} + keys[key] = val } } return keys, scanner.Err() From 97ab644903a707a8f5928abf11fc52f93bf8b878 Mon Sep 17 00:00:00 2001 From: Abhishek Pattanayak Date: Sun, 8 Mar 2026 17:50:49 +0000 Subject: [PATCH 2/3] feat(env): warn on env keys present but empty Closes #14 --- internal/check/env.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/check/env.go b/internal/check/env.go index c480f1f..9e9bf18 100644 --- a/internal/check/env.go +++ b/internal/check/env.go @@ -52,6 +52,17 @@ func (c *EnvCheck) Run(_ context.Context) Result { } } + for k, v := range actualKeys { + if v == "" { + return Result{ + Name: c.Name(), + Status: StatusWarn, + Message: fmt.Sprintf("key %s is present but has no value", k), + Fix: "fill in the value for the key in your .env file", + } + } + } + return Result{ Name: c.Name(), Status: StatusPass, From 3b8a6d95cbd2d7efa5deaf6fd09e2d77e06a5dff Mon Sep 17 00:00:00 2001 From: Abhishek Pattanayak Date: Mon, 9 Mar 2026 19:12:48 +0000 Subject: [PATCH 3/3] fix(env): report all empty env keys instead of just the first --- internal/check/env.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/check/env.go b/internal/check/env.go index 9e9bf18..000b033 100644 --- a/internal/check/env.go +++ b/internal/check/env.go @@ -52,14 +52,19 @@ func (c *EnvCheck) Run(_ context.Context) Result { } } + var empty []string for k, v := range actualKeys { if v == "" { - return Result{ - Name: c.Name(), - Status: StatusWarn, - Message: fmt.Sprintf("key %s is present but has no value", k), - Fix: "fill in the value for the key in your .env file", - } + empty = append(empty, k) + } + } + + if len(empty) > 0 { + return Result{ + Name: c.Name(), + Status: StatusWarn, + Message: fmt.Sprintf("empty values for keys: %s", strings.Join(empty, ", ")), + Fix: "fill in the values for the empty keys in your .env file", } }